all da files
This commit is contained in:
		
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
node_modules
 | 
			
		||||
							
								
								
									
										21
									
								
								node_modules/filesystem-browserify/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								node_modules/filesystem-browserify/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
# filesystem-browser
 | 
			
		||||
 | 
			
		||||
A (partial) implementation of
 | 
			
		||||
[node's `fs`](http://nodejs.org/docs/latest/api/fs.html) in the browser,
 | 
			
		||||
on top of
 | 
			
		||||
[IndexedDB](https://developer.mozilla.org/en-US/docs/IndexedDB) (by way
 | 
			
		||||
of [IDBWrapper](http://jensarps.github.com/IDBWrapper/))
 | 
			
		||||
 | 
			
		||||
# what's implemented
 | 
			
		||||
 | 
			
		||||
* `fs.readdir`
 | 
			
		||||
* `fs.readFile`
 | 
			
		||||
* `fs.writeFile`
 | 
			
		||||
* `fs.unlink`
 | 
			
		||||
* `fs.rename`
 | 
			
		||||
* `fs.createReadStream`
 | 
			
		||||
* `fs.createWriteStream`
 | 
			
		||||
 | 
			
		||||
# tests
 | 
			
		||||
 | 
			
		||||
I need 'em.
 | 
			
		||||
							
								
								
									
										235
									
								
								node_modules/filesystem-browserify/bundle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										235
									
								
								node_modules/filesystem-browserify/bundle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										141
									
								
								node_modules/filesystem-browserify/datastore.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								node_modules/filesystem-browserify/datastore.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,141 @@
 | 
			
		||||
const util = require('util');
 | 
			
		||||
const IDBStore = require('idb-wrapper');
 | 
			
		||||
const EventEmitter = require('events').EventEmitter;
 | 
			
		||||
 | 
			
		||||
function nothing() {}
 | 
			
		||||
 | 
			
		||||
function DataStore(name) {
 | 
			
		||||
  this.ready = false;
 | 
			
		||||
  this.store = new IDBStore({
 | 
			
		||||
    storeName: 'PseudoFS',
 | 
			
		||||
    onStoreReady: function () {
 | 
			
		||||
      this.ready = true;
 | 
			
		||||
      this.emit('ready')
 | 
			
		||||
      this._flush();
 | 
			
		||||
    }.bind(this)
 | 
			
		||||
  });
 | 
			
		||||
  this.queue = [];
 | 
			
		||||
};
 | 
			
		||||
util.inherits(DataStore, EventEmitter);
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.writeFile = function writeFile(path, data, callback) {
 | 
			
		||||
  callback = callback || nothing;
 | 
			
		||||
  if (!this.ready)
 | 
			
		||||
    return this._enqueue({
 | 
			
		||||
      type: 'write',
 | 
			
		||||
      args: [path, data, callback],
 | 
			
		||||
    });
 | 
			
		||||
  return this.__write(path, data, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.readFile = function readFile(path, callback) {
 | 
			
		||||
  callback = callback || nothing;
 | 
			
		||||
  if (!this.ready)
 | 
			
		||||
    return this._enqueue({
 | 
			
		||||
      type: 'read',
 | 
			
		||||
      args: [path, callback],
 | 
			
		||||
    });
 | 
			
		||||
  return this.__read(path, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.readdir = function readdir(path, callback) {
 | 
			
		||||
  if (!this.ready)
 | 
			
		||||
    return this._enqueue({
 | 
			
		||||
      type: 'readdir',
 | 
			
		||||
      args: [path, callback],
 | 
			
		||||
    });
 | 
			
		||||
  return this.__readdir(path, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.unlink = function unlink(path, callback) {
 | 
			
		||||
  callback = callback || nothing;
 | 
			
		||||
  if (!this.ready)
 | 
			
		||||
    return this._enqueue({
 | 
			
		||||
      type: 'unlink',
 | 
			
		||||
      args: [path, callback],
 | 
			
		||||
    });
 | 
			
		||||
  return this.__unlink(path, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.rename = function rename(path, newPath, callback) {
 | 
			
		||||
  callback = callback || nothing;
 | 
			
		||||
  if (!this.ready)
 | 
			
		||||
    return this._enqueue({
 | 
			
		||||
      type: 'rename',
 | 
			
		||||
      args: [path, newPath, callback],
 | 
			
		||||
    });
 | 
			
		||||
  return this.__rename(path, newPath, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype._enqueue = function enqueue(actionPlan) {
 | 
			
		||||
  console.log('queuing', actionPlan.type);
 | 
			
		||||
  this.queue.push(actionPlan);
 | 
			
		||||
  if (this.ready)
 | 
			
		||||
    this._flush();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype._flush = function flush() {
 | 
			
		||||
  var action;
 | 
			
		||||
  while ((action = this.queue.shift())) {
 | 
			
		||||
    var method = this['__' + action.type];
 | 
			
		||||
    method.apply(this, action.args);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.__write = function write(path, data, callback) {
 | 
			
		||||
  const dataObj = {
 | 
			
		||||
    id: path,
 | 
			
		||||
    data: data,
 | 
			
		||||
    lastModified: Date.now(),
 | 
			
		||||
  };
 | 
			
		||||
  this.store.put(dataObj, function success() {
 | 
			
		||||
    callback(null);
 | 
			
		||||
  }, function error(err) {
 | 
			
		||||
    callback(err);
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.__read = function read(path, callback) {
 | 
			
		||||
  this.store.get(path, function success(data) {
 | 
			
		||||
    callback(null, data);
 | 
			
		||||
  }, function error(err) {
 | 
			
		||||
    callback(err);
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.__readdir = function read(path, callback) {
 | 
			
		||||
  this.store.getAll(function success(data) {
 | 
			
		||||
    callback(null, data.map(extract('id')));
 | 
			
		||||
  }, function error(err) {
 | 
			
		||||
    callback(err);
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.__unlink = function unlink(path, callback) {
 | 
			
		||||
  this.store.remove(path, function success() {
 | 
			
		||||
    callback();
 | 
			
		||||
  }, function error(err) {
 | 
			
		||||
    callback(err);
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DataStore.prototype.__rename = function rename(path, newPath, callback) {
 | 
			
		||||
  console.log('renmaing');
 | 
			
		||||
  this.readFile(path, function (err, data) {
 | 
			
		||||
    if (err) return callback(err);
 | 
			
		||||
    this.writeFile(newPath, data, function (err) {
 | 
			
		||||
      if (err) return callback(err);
 | 
			
		||||
      this.unlink(path, function (err) {
 | 
			
		||||
        return callback(err);
 | 
			
		||||
      }.bind(this));
 | 
			
		||||
    }.bind(this));
 | 
			
		||||
  }.bind(this));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function extract(field) {
 | 
			
		||||
  return function (doc) {
 | 
			
		||||
    return doc[field];
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = DataStore;
 | 
			
		||||
							
								
								
									
										61
									
								
								node_modules/filesystem-browserify/example.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								node_modules/filesystem-browserify/example.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
const fs = require('./');
 | 
			
		||||
const FileListStream = require('fileliststream');
 | 
			
		||||
 | 
			
		||||
const logger = {
 | 
			
		||||
  write: function write(data) {
 | 
			
		||||
    const textAreaElem = document.getElementById('output');
 | 
			
		||||
    textAreaElem.innerHTML = data;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
const body = document.body;
 | 
			
		||||
function noop(name) {
 | 
			
		||||
  return function (event) {
 | 
			
		||||
    event.preventDefault();
 | 
			
		||||
    event.stopPropagation();
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
body.addEventListener('dragenter', noop('dragEnter'));
 | 
			
		||||
body.addEventListener('dragleave', noop('dragLeave'));
 | 
			
		||||
body.addEventListener('dragexit', noop('dragExit'));
 | 
			
		||||
body.addEventListener('dragover', noop('dragOver'));
 | 
			
		||||
body.addEventListener('drop', function (event) {
 | 
			
		||||
  event.stopPropagation();
 | 
			
		||||
  event.preventDefault();
 | 
			
		||||
 | 
			
		||||
  const fileListStream = FileListStream(event.dataTransfer.files);
 | 
			
		||||
  const file = fileListStream[0];
 | 
			
		||||
 | 
			
		||||
  const writestream = fs.createWriteStream(file.name);
 | 
			
		||||
  file.pipe(writestream).on('close', function () {
 | 
			
		||||
    addLinkItem(writestream.path);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return false;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
function addLinkItem(path) {
 | 
			
		||||
  const ol = document.getElementById('fileList');
 | 
			
		||||
  const liElem = document.createElement('li');
 | 
			
		||||
  const aElem = document.createElement('a');
 | 
			
		||||
  aElem.innerHTML = path;
 | 
			
		||||
 | 
			
		||||
  aElem.addEventListener('click', function () {
 | 
			
		||||
    const readstream = fs.createReadStream(path);
 | 
			
		||||
    readstream.pipe(logger);
 | 
			
		||||
    event.preventDefault();
 | 
			
		||||
    return false;
 | 
			
		||||
  }, false);
 | 
			
		||||
 | 
			
		||||
  liElem.appendChild(aElem);
 | 
			
		||||
  ol.appendChild(liElem);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
(function () {
 | 
			
		||||
  fs.readdir('.', function (err, files) {
 | 
			
		||||
    files.map(addLinkItem);
 | 
			
		||||
  });
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
window.fs = fs;
 | 
			
		||||
							
								
								
									
										524
									
								
								node_modules/filesystem-browserify/idbstore.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										524
									
								
								node_modules/filesystem-browserify/idbstore.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,524 @@
 | 
			
		||||
/*
 | 
			
		||||
 * IDBWrapper - A cross-browser wrapper for IndexedDB
 | 
			
		||||
 * Copyright (c) 2011 - 2013 Jens Arps
 | 
			
		||||
 * http://jensarps.de/
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the MIT (X11) license
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
(function (name, definition, global) {
 | 
			
		||||
  if (typeof define === 'function') {
 | 
			
		||||
    define(definition);
 | 
			
		||||
  } else if (typeof module !== 'undefined' && module.exports) {
 | 
			
		||||
    module.exports = definition();
 | 
			
		||||
  } else {
 | 
			
		||||
    global[name] = definition();
 | 
			
		||||
  }
 | 
			
		||||
})('IDBStore', function () {
 | 
			
		||||
 | 
			
		||||
  var IDBStore;
 | 
			
		||||
 | 
			
		||||
  var defaults = {
 | 
			
		||||
    storeName: 'Store',
 | 
			
		||||
    storePrefix: 'IDBWrapper-',
 | 
			
		||||
    dbVersion: 1,
 | 
			
		||||
    keyPath: 'id',
 | 
			
		||||
    autoIncrement: true,
 | 
			
		||||
    onStoreReady: function () {
 | 
			
		||||
    },
 | 
			
		||||
    onError: function(error){
 | 
			
		||||
      throw error;
 | 
			
		||||
    },
 | 
			
		||||
    indexes: []
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  IDBStore = function (kwArgs, onStoreReady) {
 | 
			
		||||
 | 
			
		||||
    for(var key in defaults){
 | 
			
		||||
      this[key] = typeof kwArgs[key] != 'undefined' ? kwArgs[key] : defaults[key];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.dbName = this.storePrefix + this.storeName;
 | 
			
		||||
    this.dbVersion = parseInt(this.dbVersion, 10);
 | 
			
		||||
 | 
			
		||||
    onStoreReady && (this.onStoreReady = onStoreReady);
 | 
			
		||||
 | 
			
		||||
    this.idb = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;
 | 
			
		||||
    this.keyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.mozIDBKeyRange;
 | 
			
		||||
 | 
			
		||||
    this.consts = {
 | 
			
		||||
      'READ_ONLY':         'readonly',
 | 
			
		||||
      'READ_WRITE':        'readwrite',
 | 
			
		||||
      'VERSION_CHANGE':    'versionchange',
 | 
			
		||||
      'NEXT':              'next',
 | 
			
		||||
      'NEXT_NO_DUPLICATE': 'nextunique',
 | 
			
		||||
      'PREV':              'prev',
 | 
			
		||||
      'PREV_NO_DUPLICATE': 'prevunique'
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    this.openDB();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  IDBStore.prototype = {
 | 
			
		||||
 | 
			
		||||
    version: '0.3.2',
 | 
			
		||||
 | 
			
		||||
    db: null,
 | 
			
		||||
 | 
			
		||||
    dbName: null,
 | 
			
		||||
 | 
			
		||||
    dbVersion: null,
 | 
			
		||||
 | 
			
		||||
    store: null,
 | 
			
		||||
 | 
			
		||||
    storeName: null,
 | 
			
		||||
 | 
			
		||||
    keyPath: null,
 | 
			
		||||
 | 
			
		||||
    autoIncrement: null,
 | 
			
		||||
 | 
			
		||||
    indexes: null,
 | 
			
		||||
 | 
			
		||||
    features: null,
 | 
			
		||||
 | 
			
		||||
    onStoreReady: null,
 | 
			
		||||
 | 
			
		||||
    onError: null,
 | 
			
		||||
 | 
			
		||||
    _insertIdCount: 0,
 | 
			
		||||
 | 
			
		||||
    openDB: function () {
 | 
			
		||||
 | 
			
		||||
      var features = this.features = {};
 | 
			
		||||
      features.hasAutoIncrement = !window.mozIndexedDB; // TODO: Still, really?
 | 
			
		||||
 | 
			
		||||
      var openRequest = this.idb.open(this.dbName, this.dbVersion);
 | 
			
		||||
      var preventSuccessCallback = false;
 | 
			
		||||
 | 
			
		||||
      openRequest.onerror = function (error) {
 | 
			
		||||
 | 
			
		||||
        var gotVersionErr = false;
 | 
			
		||||
        if ('error' in error.target) {
 | 
			
		||||
          gotVersionErr = error.target.error.name == "VersionError";
 | 
			
		||||
        } else if ('errorCode' in error.target) {
 | 
			
		||||
          gotVersionErr = error.target.errorCode == 12; // TODO: Use const
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (gotVersionErr) {
 | 
			
		||||
          this.onError(new Error('The version number provided is lower than the existing one.'));
 | 
			
		||||
        } else {
 | 
			
		||||
          this.onError(error);
 | 
			
		||||
        }
 | 
			
		||||
      }.bind(this);
 | 
			
		||||
 | 
			
		||||
      openRequest.onsuccess = function (event) {
 | 
			
		||||
 | 
			
		||||
        if (preventSuccessCallback) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(this.db){
 | 
			
		||||
          this.onStoreReady();
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.db = event.target.result;
 | 
			
		||||
 | 
			
		||||
        if(typeof this.db.version == 'string'){
 | 
			
		||||
          this.onError(new Error('The IndexedDB implementation in this browser is outdated. Please upgrade your browser.'));
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(!this.db.objectStoreNames.contains(this.storeName)){
 | 
			
		||||
          // We should never ever get here.
 | 
			
		||||
          // Lets notify the user anyway.
 | 
			
		||||
          this.onError(new Error('Something is wrong with the IndexedDB implementation in this browser. Please upgrade your browser.'));
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        var emptyTransaction = this.db.transaction([this.storeName], this.consts.READ_ONLY);
 | 
			
		||||
        this.store = emptyTransaction.objectStore(this.storeName);
 | 
			
		||||
 | 
			
		||||
        // check indexes
 | 
			
		||||
        this.indexes.forEach(function(indexData){
 | 
			
		||||
          var indexName = indexData.name;
 | 
			
		||||
 | 
			
		||||
          if(!indexName){
 | 
			
		||||
            preventSuccessCallback = true;
 | 
			
		||||
            this.onError(new Error('Cannot create index: No index name given.'));
 | 
			
		||||
            return;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          this.normalizeIndexData(indexData);
 | 
			
		||||
 | 
			
		||||
          if(this.hasIndex(indexName)){
 | 
			
		||||
            // check if it complies
 | 
			
		||||
            var actualIndex = this.store.index(indexName);
 | 
			
		||||
            var complies = this.indexComplies(actualIndex, indexData);
 | 
			
		||||
            if(!complies){
 | 
			
		||||
              preventSuccessCallback = true;
 | 
			
		||||
              this.onError(new Error('Cannot modify index "' + indexName + '" for current version. Please bump version number to ' + ( this.dbVersion + 1 ) + '.'));
 | 
			
		||||
            }
 | 
			
		||||
          } else {
 | 
			
		||||
            preventSuccessCallback = true;
 | 
			
		||||
            this.onError(new Error('Cannot create new index "' + indexName + '" for current version. Please bump version number to ' + ( this.dbVersion + 1 ) + '.'));
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
        }, this);
 | 
			
		||||
 | 
			
		||||
        preventSuccessCallback || this.onStoreReady();
 | 
			
		||||
      }.bind(this);
 | 
			
		||||
 | 
			
		||||
      openRequest.onupgradeneeded = function(/* IDBVersionChangeEvent */ event){
 | 
			
		||||
 | 
			
		||||
        this.db = event.target.result;
 | 
			
		||||
 | 
			
		||||
        if(this.db.objectStoreNames.contains(this.storeName)){
 | 
			
		||||
          this.store = event.target.transaction.objectStore(this.storeName);
 | 
			
		||||
        } else {
 | 
			
		||||
          this.store = this.db.createObjectStore(this.storeName, { keyPath: this.keyPath, autoIncrement: this.autoIncrement});
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.indexes.forEach(function(indexData){
 | 
			
		||||
          var indexName = indexData.name;
 | 
			
		||||
 | 
			
		||||
          if(!indexName){
 | 
			
		||||
            preventSuccessCallback = true;
 | 
			
		||||
            this.onError(new Error('Cannot create index: No index name given.'));
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          this.normalizeIndexData(indexData);
 | 
			
		||||
 | 
			
		||||
          if(this.hasIndex(indexName)){
 | 
			
		||||
            // check if it complies
 | 
			
		||||
            var actualIndex = this.store.index(indexName);
 | 
			
		||||
            var complies = this.indexComplies(actualIndex, indexData);
 | 
			
		||||
            if(!complies){
 | 
			
		||||
              // index differs, need to delete and re-create
 | 
			
		||||
              this.store.deleteIndex(indexName);
 | 
			
		||||
              this.store.createIndex(indexName, indexData.keyPath, { unique: indexData.unique, multiEntry: indexData.multiEntry });
 | 
			
		||||
            }
 | 
			
		||||
          } else {
 | 
			
		||||
            this.store.createIndex(indexName, indexData.keyPath, { unique: indexData.unique, multiEntry: indexData.multiEntry });
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
        }, this);
 | 
			
		||||
 | 
			
		||||
      }.bind(this);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    deleteDatabase: function () {
 | 
			
		||||
      if (this.idb.deleteDatabase) {
 | 
			
		||||
        this.idb.deleteDatabase(this.dbName);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /*********************
 | 
			
		||||
     * data manipulation *
 | 
			
		||||
     *********************/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    put: function (dataObj, onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not write data.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      if (typeof dataObj[this.keyPath] == 'undefined' && !this.features.hasAutoIncrement) {
 | 
			
		||||
        dataObj[this.keyPath] = this._getUID();
 | 
			
		||||
      }
 | 
			
		||||
      var putTransaction = this.db.transaction([this.storeName], this.consts.READ_WRITE);
 | 
			
		||||
      var putRequest = putTransaction.objectStore(this.storeName).put(dataObj);
 | 
			
		||||
      putRequest.onsuccess = function (event) {
 | 
			
		||||
        onSuccess(event.target.result);
 | 
			
		||||
      };
 | 
			
		||||
      putRequest.onerror = onError;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    get: function (key, onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not read data.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      var getTransaction = this.db.transaction([this.storeName], this.consts.READ_ONLY);
 | 
			
		||||
      var getRequest = getTransaction.objectStore(this.storeName).get(key);
 | 
			
		||||
      getRequest.onsuccess = function (event) {
 | 
			
		||||
        onSuccess(event.target.result);
 | 
			
		||||
      };
 | 
			
		||||
      getRequest.onerror = onError;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    remove: function (key, onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not remove data.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      var removeTransaction = this.db.transaction([this.storeName], this.consts.READ_WRITE);
 | 
			
		||||
      var deleteRequest = removeTransaction.objectStore(this.storeName)['delete'](key);
 | 
			
		||||
      deleteRequest.onsuccess = function (event) {
 | 
			
		||||
        onSuccess(event.target.result);
 | 
			
		||||
      };
 | 
			
		||||
      deleteRequest.onerror = onError;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    batch: function (arr, onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not apply batch.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      var batchTransaction = this.db.transaction([this.storeName] , this.consts.READ_WRITE);
 | 
			
		||||
      var count = arr.length;
 | 
			
		||||
      var called = false;
 | 
			
		||||
 | 
			
		||||
      arr.forEach(function (operation) {
 | 
			
		||||
        var type = operation.type;
 | 
			
		||||
        var key = operation.key;
 | 
			
		||||
        var value = operation.value;
 | 
			
		||||
 | 
			
		||||
        if (type == "remove") {
 | 
			
		||||
          var deleteRequest = batchTransaction.objectStore(this.storeName)['delete'](key);
 | 
			
		||||
          deleteRequest.onsuccess = function (event) {
 | 
			
		||||
            count--;
 | 
			
		||||
            if (count == 0 && !called) {
 | 
			
		||||
              called = true;
 | 
			
		||||
              onSuccess();
 | 
			
		||||
            }
 | 
			
		||||
          };
 | 
			
		||||
          deleteRequest.onerror = function (err) {
 | 
			
		||||
            batchTransaction.abort();
 | 
			
		||||
            if (!called) {
 | 
			
		||||
              called = true;
 | 
			
		||||
              onError(err, type, key);
 | 
			
		||||
            }
 | 
			
		||||
          };
 | 
			
		||||
        } else if (type == "put") {
 | 
			
		||||
          if (typeof value[this.keyPath] == 'undefined' && !this.features.hasAutoIncrement) {
 | 
			
		||||
            value[this.keyPath] = this._getUID()
 | 
			
		||||
          }
 | 
			
		||||
          var putRequest = batchTransaction.objectStore(this.storeName).put(value);
 | 
			
		||||
          putRequest.onsuccess = function (event) {
 | 
			
		||||
            count--;
 | 
			
		||||
            if (count == 0 && !called) {
 | 
			
		||||
              called = true;
 | 
			
		||||
              onSuccess();
 | 
			
		||||
            }
 | 
			
		||||
          };
 | 
			
		||||
          putRequest.onerror = function (err) {
 | 
			
		||||
            batchTransaction.abort();
 | 
			
		||||
            if (!called) {
 | 
			
		||||
              called = true;
 | 
			
		||||
              onError(err, type, value);
 | 
			
		||||
            }
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      }, this);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    getAll: function (onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not read data.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      var getAllTransaction = this.db.transaction([this.storeName], this.consts.READ_ONLY);
 | 
			
		||||
      var store = getAllTransaction.objectStore(this.storeName);
 | 
			
		||||
      if (store.getAll) {
 | 
			
		||||
        var getAllRequest = store.getAll();
 | 
			
		||||
        getAllRequest.onsuccess = function (event) {
 | 
			
		||||
          onSuccess(event.target.result);
 | 
			
		||||
        };
 | 
			
		||||
        getAllRequest.onerror = onError;
 | 
			
		||||
      } else {
 | 
			
		||||
        this._getAllCursor(getAllTransaction, onSuccess, onError);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    _getAllCursor: function (tr, onSuccess, onError) {
 | 
			
		||||
      var all = [];
 | 
			
		||||
      var store = tr.objectStore(this.storeName);
 | 
			
		||||
      var cursorRequest = store.openCursor();
 | 
			
		||||
 | 
			
		||||
      cursorRequest.onsuccess = function (event) {
 | 
			
		||||
        var cursor = event.target.result;
 | 
			
		||||
        if (cursor) {
 | 
			
		||||
          all.push(cursor.value);
 | 
			
		||||
          cursor['continue']();
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
          onSuccess(all);
 | 
			
		||||
        }
 | 
			
		||||
      };
 | 
			
		||||
      cursorRequest.onError = onError;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    clear: function (onSuccess, onError) {
 | 
			
		||||
      onError || (onError = function (error) {
 | 
			
		||||
        console.error('Could not clear store.', error);
 | 
			
		||||
      });
 | 
			
		||||
      onSuccess || (onSuccess = noop);
 | 
			
		||||
      var clearTransaction = this.db.transaction([this.storeName], this.consts.READ_WRITE);
 | 
			
		||||
      var clearRequest = clearTransaction.objectStore(this.storeName).clear();
 | 
			
		||||
      clearRequest.onsuccess = function (event) {
 | 
			
		||||
        onSuccess(event.target.result);
 | 
			
		||||
      };
 | 
			
		||||
      clearRequest.onerror = onError;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    _getUID: function () {
 | 
			
		||||
      // FF bails at times on non-numeric ids. So we take an even
 | 
			
		||||
      // worse approach now, using current time as id. Sigh.
 | 
			
		||||
      return this._insertIdCount++ + Date.now();
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /************
 | 
			
		||||
     * indexing *
 | 
			
		||||
     ************/
 | 
			
		||||
 | 
			
		||||
    getIndexList: function () {
 | 
			
		||||
      return this.store.indexNames;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    hasIndex: function (indexName) {
 | 
			
		||||
      return this.store.indexNames.contains(indexName);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    normalizeIndexData: function (indexData) {
 | 
			
		||||
      indexData.keyPath = indexData.keyPath || indexData.name;
 | 
			
		||||
      indexData.unique = !!indexData.unique;
 | 
			
		||||
      indexData.multiEntry = !!indexData.multiEntry;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    indexComplies: function (actual, expected) {
 | 
			
		||||
      var complies = ['keyPath', 'unique', 'multiEntry'].every(function (key) {
 | 
			
		||||
        // IE10 returns undefined for no multiEntry
 | 
			
		||||
        if (key == 'multiEntry' && actual[key] === undefined && expected[key] === false) {
 | 
			
		||||
          return true;
 | 
			
		||||
        }
 | 
			
		||||
        return expected[key] == actual[key];
 | 
			
		||||
      });
 | 
			
		||||
      return complies;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**********
 | 
			
		||||
     * cursor *
 | 
			
		||||
     **********/
 | 
			
		||||
 | 
			
		||||
    iterate: function (onItem, options) {
 | 
			
		||||
      options = mixin({
 | 
			
		||||
        index: null,
 | 
			
		||||
        order: 'ASC',
 | 
			
		||||
        filterDuplicates: false,
 | 
			
		||||
        keyRange: null,
 | 
			
		||||
        writeAccess: false,
 | 
			
		||||
        onEnd: null,
 | 
			
		||||
        onError: function (error) {
 | 
			
		||||
          console.error('Could not open cursor.', error);
 | 
			
		||||
        }
 | 
			
		||||
      }, options || {});
 | 
			
		||||
 | 
			
		||||
      var directionType = options.order.toLowerCase() == 'desc' ? 'PREV' : 'NEXT';
 | 
			
		||||
      if (options.filterDuplicates) {
 | 
			
		||||
        directionType += '_NO_DUPLICATE';
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var cursorTransaction = this.db.transaction([this.storeName], this.consts[options.writeAccess ? 'READ_WRITE' : 'READ_ONLY']);
 | 
			
		||||
      var cursorTarget = cursorTransaction.objectStore(this.storeName);
 | 
			
		||||
      if (options.index) {
 | 
			
		||||
        cursorTarget = cursorTarget.index(options.index);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var cursorRequest = cursorTarget.openCursor(options.keyRange, this.consts[directionType]);
 | 
			
		||||
      cursorRequest.onerror = options.onError;
 | 
			
		||||
      cursorRequest.onsuccess = function (event) {
 | 
			
		||||
        var cursor = event.target.result;
 | 
			
		||||
        if (cursor) {
 | 
			
		||||
          onItem(cursor.value, cursor, cursorTransaction);
 | 
			
		||||
          cursor['continue']();
 | 
			
		||||
        } else {
 | 
			
		||||
          if(options.onEnd){
 | 
			
		||||
            options.onEnd()
 | 
			
		||||
          } else {
 | 
			
		||||
            onItem(null);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    count: function (onSuccess, options) {
 | 
			
		||||
 | 
			
		||||
      options = mixin({
 | 
			
		||||
        index: null,
 | 
			
		||||
        keyRange: null
 | 
			
		||||
      }, options || {});
 | 
			
		||||
 | 
			
		||||
      var onError = options.onError || function (error) {
 | 
			
		||||
        console.error('Could not open cursor.', error);
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      var cursorTransaction = this.db.transaction([this.storeName], this.consts.READ_ONLY);
 | 
			
		||||
      var cursorTarget = cursorTransaction.objectStore(this.storeName);
 | 
			
		||||
      if (options.index) {
 | 
			
		||||
        cursorTarget = cursorTarget.index(options.index);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var countRequest = cursorTarget.count(options.keyRange);
 | 
			
		||||
      countRequest.onsuccess = function (evt) {
 | 
			
		||||
        onSuccess(evt.target.result);
 | 
			
		||||
      };
 | 
			
		||||
      countRequest.onError = function (error) {
 | 
			
		||||
        onError(error);
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**************/
 | 
			
		||||
    /* key ranges */
 | 
			
		||||
    /**************/
 | 
			
		||||
 | 
			
		||||
    makeKeyRange: function(options){
 | 
			
		||||
      var keyRange,
 | 
			
		||||
          hasLower = typeof options.lower != 'undefined',
 | 
			
		||||
          hasUpper = typeof options.upper != 'undefined';
 | 
			
		||||
 | 
			
		||||
      switch(true){
 | 
			
		||||
        case hasLower && hasUpper:
 | 
			
		||||
          keyRange = this.keyRange.bound(options.lower, options.upper, options.excludeLower, options.excludeUpper);
 | 
			
		||||
          break;
 | 
			
		||||
        case hasLower:
 | 
			
		||||
          keyRange = this.keyRange.lowerBound(options.lower, options.excludeLower);
 | 
			
		||||
          break;
 | 
			
		||||
        case hasUpper:
 | 
			
		||||
          keyRange = this.keyRange.upperBound(options.upper, options.excludeUpper);
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          throw new Error('Cannot create KeyRange. Provide one or both of "lower" or "upper" value.');
 | 
			
		||||
          break;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return keyRange;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  /** helpers **/
 | 
			
		||||
 | 
			
		||||
  var noop = function () {
 | 
			
		||||
  };
 | 
			
		||||
  var empty = {};
 | 
			
		||||
  var mixin = function (target, source) {
 | 
			
		||||
    var name, s;
 | 
			
		||||
    for (name in source) {
 | 
			
		||||
      s = source[name];
 | 
			
		||||
      if (s !== empty[name] && s !== target[name]) {
 | 
			
		||||
        target[name] = s;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return target;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  IDBStore.version = IDBStore.prototype.version;
 | 
			
		||||
 | 
			
		||||
  return IDBStore;
 | 
			
		||||
 | 
			
		||||
}, this);
 | 
			
		||||
							
								
								
									
										7
									
								
								node_modules/filesystem-browserify/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								node_modules/filesystem-browserify/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <body style="width: 100%; height: 100%; padding: 0; background: #aaf">
 | 
			
		||||
    <ul id="fileList"></ul>
 | 
			
		||||
    <textarea id="output"></textarea>
 | 
			
		||||
    <script src='bundle.js'></script>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										54
									
								
								node_modules/filesystem-browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								node_modules/filesystem-browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
const util = require('util');
 | 
			
		||||
const Stream = require('stream');
 | 
			
		||||
const DataStore = require('./datastore');
 | 
			
		||||
const fs = {};
 | 
			
		||||
const FILESYSTEM = new DataStore();
 | 
			
		||||
 | 
			
		||||
fs.createWriteStream = function createWriteStream(path) {
 | 
			
		||||
  return new WriteStream(path);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
fs.createReadStream = function createReadStream(path) {
 | 
			
		||||
  return new ReadStream(path);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
fs.rename = FILESYSTEM.rename.bind(FILESYSTEM);
 | 
			
		||||
fs.writeFile = FILESYSTEM.writeFile.bind(FILESYSTEM);
 | 
			
		||||
fs.readFile = FILESYSTEM.writeFile.bind(FILESYSTEM);
 | 
			
		||||
fs.readdir = FILESYSTEM.readdir.bind(FILESYSTEM);
 | 
			
		||||
fs.unlink = FILESYSTEM.unlink.bind(FILESYSTEM);
 | 
			
		||||
 | 
			
		||||
function WriteStream(path) {
 | 
			
		||||
  this._buffer = '';
 | 
			
		||||
  this.path = path;
 | 
			
		||||
  this.writable = true;
 | 
			
		||||
  this.bytesWritten = 0;
 | 
			
		||||
};
 | 
			
		||||
util.inherits(WriteStream, Stream);
 | 
			
		||||
 | 
			
		||||
WriteStream.prototype.write = function write(data) {
 | 
			
		||||
  this._buffer += data;
 | 
			
		||||
  this.bytesWritten += data.length;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
WriteStream.prototype.end = function end() {
 | 
			
		||||
  FILESYSTEM.writeFile(this.path, this._buffer, function (err) {
 | 
			
		||||
    this.emit('close');
 | 
			
		||||
  }.bind(this));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function ReadStream(path) {
 | 
			
		||||
  this.readable = true;
 | 
			
		||||
  this.path = path;
 | 
			
		||||
};
 | 
			
		||||
util.inherits(ReadStream, Stream);
 | 
			
		||||
 | 
			
		||||
ReadStream.prototype.pipe = function pipe(dest) {
 | 
			
		||||
  console.log('path', this.path);
 | 
			
		||||
  FILESYSTEM.readFile(this.path, function (err, dataObj) {
 | 
			
		||||
    dest.write(dataObj.data);
 | 
			
		||||
  });
 | 
			
		||||
  return dest;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
module.exports = fs;
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/.bin/browserify
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/.bin/browserify
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
../browserify/bin/cmd.js
 | 
			
		||||
							
								
								
									
										4
									
								
								node_modules/filesystem-browserify/node_modules/browserify/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								node_modules/filesystem-browserify/node_modules/browserify/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
language: node_js
 | 
			
		||||
node_js:
 | 
			
		||||
  - 0.6
 | 
			
		||||
  - 0.8
 | 
			
		||||
							
								
								
									
										63
									
								
								node_modules/filesystem-browserify/node_modules/browserify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								node_modules/filesystem-browserify/node_modules/browserify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
Some pieces from builtins/ taken from node core under this license:
 | 
			
		||||
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
Copyright Joyent, Inc. and other Node contributors.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
buffer_ieee754.js has this license in it:
 | 
			
		||||
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2008, Fair Oaks Labs, Inc.
 | 
			
		||||
All rights reserved.
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without
 | 
			
		||||
modification, are permitted provided that the following conditions are met:
 | 
			
		||||
 | 
			
		||||
 * Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
   this list of conditions and the following disclaimer.
 | 
			
		||||
 | 
			
		||||
 * Redistributions in binary form must reproduce the above copyright notice,
 | 
			
		||||
   this list of conditions and the following disclaimer in the documentation
 | 
			
		||||
   and/or other materials provided with the distribution.
 | 
			
		||||
 | 
			
		||||
 * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
 | 
			
		||||
   may be used to endorse or promote products derived from this software
 | 
			
		||||
   without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 | 
			
		||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 | 
			
		||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
Modifications to writeIEEE754 to support negative zeroes made by Brian White
 | 
			
		||||
 | 
			
		||||
----
 | 
			
		||||
							
								
								
									
										172
									
								
								node_modules/filesystem-browserify/node_modules/browserify/README.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										172
									
								
								node_modules/filesystem-browserify/node_modules/browserify/README.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,172 @@
 | 
			
		||||
browserify
 | 
			
		||||
==========
 | 
			
		||||
 | 
			
		||||
Make node-style require() work in the browser with a server-side build step,
 | 
			
		||||
as if by magic!
 | 
			
		||||
 | 
			
		||||
[](http://travis-ci.org/substack/node-browserify)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
example
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
Just write an `entry.js` to start with some `require()`s in it:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
// use relative requires
 | 
			
		||||
var foo = require('./foo');
 | 
			
		||||
var bar = require('../lib/bar');
 | 
			
		||||
 | 
			
		||||
// or use modules installed by npm into node_modules/
 | 
			
		||||
var gamma = require('gamma');
 | 
			
		||||
 | 
			
		||||
var elem = document.getElementById('result');
 | 
			
		||||
var x = foo(100) + bar('baz');
 | 
			
		||||
elem.textContent = gamma(x);
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
Now just use the `browserify` command to build a bundle starting at `entry.js`:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
$ browserify entry.js -o bundle.js
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
All of the modules that `entry.js` needs are included in the final bundle from a
 | 
			
		||||
recursive walk using [detective](https://github.com/substack/node-detective).
 | 
			
		||||
 | 
			
		||||
To use the bundle, just toss a `<script src="bundle.js"></script>` into your
 | 
			
		||||
html!
 | 
			
		||||
 | 
			
		||||
usage
 | 
			
		||||
=====
 | 
			
		||||
 | 
			
		||||
````
 | 
			
		||||
Usage: browserify [entry files] {OPTIONS}
 | 
			
		||||
 | 
			
		||||
Options:
 | 
			
		||||
  --outfile, -o  Write the browserify bundle to this file.
 | 
			
		||||
                 If unspecified, browserify prints to stdout.                   
 | 
			
		||||
  --require, -r  A module name or file to bundle.require()
 | 
			
		||||
                 Optionally use a colon separator to set the target.            
 | 
			
		||||
  --entry, -e    An entry point of your app                                     
 | 
			
		||||
  --exports      Export these core objects, comma-separated list
 | 
			
		||||
                 with any of: require, process. If unspecified, the
 | 
			
		||||
                 export behavior will be inferred.
 | 
			
		||||
                                                                                
 | 
			
		||||
  --ignore, -i   Ignore a file                                                  
 | 
			
		||||
  --alias, -a    Register an alias with a colon separator: "to:from"
 | 
			
		||||
                 Example: --alias 'jquery:jquery-browserify'                    
 | 
			
		||||
  --cache, -c    Turn on caching at $HOME/.config/browserling/cache.json or use
 | 
			
		||||
                 a file for caching.
 | 
			
		||||
                                                                 [default: true]
 | 
			
		||||
  --debug, -d    Switch on debugging mode with //@ sourceURL=...s.     [boolean]
 | 
			
		||||
  --plugin, -p   Use a plugin.
 | 
			
		||||
                 Example: --plugin aliasify                                     
 | 
			
		||||
  --prelude      Include the code that defines require() in this bundle.
 | 
			
		||||
                                                      [boolean]  [default: true]
 | 
			
		||||
  --watch, -w    Watch for changes. The script will stay open and write updates
 | 
			
		||||
                 to the output every time any of the bundled files change.
 | 
			
		||||
                 This option only works in tandem with -o.                      
 | 
			
		||||
  --verbose, -v  Write out how many bytes were written in -o mode. This is
 | 
			
		||||
                 especially useful with --watch.                                
 | 
			
		||||
  --help, -h     Show this message                                              
 | 
			
		||||
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
compatibility
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
Many [npm](http://npmjs.org) modules that don't do IO will just work after being
 | 
			
		||||
browserified. Others take more work.
 | 
			
		||||
 | 
			
		||||
[coffee script](http://coffeescript.org/) should pretty much just work.
 | 
			
		||||
Just do `browserify entry.coffee` or `require('./foo.coffee')`.
 | 
			
		||||
 | 
			
		||||
Many node built-in modules have been wrapped to work in the browser.
 | 
			
		||||
All you need to do is `require()` them like in node.
 | 
			
		||||
 | 
			
		||||
* events
 | 
			
		||||
* path
 | 
			
		||||
* [vm](https://github.com/substack/vm-browserify)
 | 
			
		||||
* [http](https://github.com/substack/http-browserify)
 | 
			
		||||
* [crypto](https://github.com/dominictarr/crypto-browserify)
 | 
			
		||||
* assert
 | 
			
		||||
* url
 | 
			
		||||
* buffer
 | 
			
		||||
* buffer_ieee754
 | 
			
		||||
* util
 | 
			
		||||
* querystring
 | 
			
		||||
* stream
 | 
			
		||||
 | 
			
		||||
process
 | 
			
		||||
-------
 | 
			
		||||
 | 
			
		||||
Browserify makes available a faux `process` object to modules with these
 | 
			
		||||
attributes:
 | 
			
		||||
 | 
			
		||||
* nextTick(fn) - uses [the postMessage trick](http://dbaron.org/log/20100309-faster-timeouts)
 | 
			
		||||
    for a faster `setTimeout(fn, 0)` if it can
 | 
			
		||||
* title - set to 'browser' for browser code, 'node' in regular node code
 | 
			
		||||
* browser - `true`, good for testing if you're in a browser or in node
 | 
			
		||||
 | 
			
		||||
By default the process object is only available inside of files wrapped by
 | 
			
		||||
browserify. To expose it, use `--exports=process`
 | 
			
		||||
 | 
			
		||||
__dirname
 | 
			
		||||
---------
 | 
			
		||||
 | 
			
		||||
The faux directory name, scrubbed of true directory information so as not to
 | 
			
		||||
expose your filesystem organization.
 | 
			
		||||
 | 
			
		||||
__filename
 | 
			
		||||
----------
 | 
			
		||||
 | 
			
		||||
The faux file path, scrubbed of true path information so as not to expose your
 | 
			
		||||
filesystem organization.
 | 
			
		||||
 | 
			
		||||
package.json
 | 
			
		||||
============
 | 
			
		||||
 | 
			
		||||
In order to resolve main files for projects, the package.json "main" field is
 | 
			
		||||
read.
 | 
			
		||||
 | 
			
		||||
If a package.json has a "browserify" field, you can override the standard "main"
 | 
			
		||||
behavior with something special just for browsers.
 | 
			
		||||
 | 
			
		||||
See [dnode's
 | 
			
		||||
package.json](https://github.com/substack/dnode/blob/9e24b97cf2ce931fbf6d7beb3731086b46bca887/package.json#L40)
 | 
			
		||||
for an example of using the "browserify" field.
 | 
			
		||||
 | 
			
		||||
more
 | 
			
		||||
====
 | 
			
		||||
 | 
			
		||||
* [browserify recipes](https://github.com/substack/node-browserify/blob/master/doc/recipes.markdown#recipes)
 | 
			
		||||
* [browserify api reference](https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#methods)
 | 
			
		||||
* [browserify cdn](http://browserify.nodejitsu.com/)
 | 
			
		||||
 | 
			
		||||
install
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
With [npm](http://npmjs.org) do:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
npm install -g browserify
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
test
 | 
			
		||||
====
 | 
			
		||||
 | 
			
		||||
To run the node tests with tap, do:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
npm test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
To run the [testling](http://testling.com) tests,
 | 
			
		||||
create a [browserling](http://browserling.com) account then:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
cd testling
 | 
			
		||||
./test.sh
 | 
			
		||||
```
 | 
			
		||||
							
								
								
									
										161
									
								
								node_modules/filesystem-browserify/node_modules/browserify/bin/cmd.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										161
									
								
								node_modules/filesystem-browserify/node_modules/browserify/bin/cmd.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,161 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
var browserify = require('../');
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
var resolve = require('resolve');
 | 
			
		||||
 | 
			
		||||
var argv = require('optimist')
 | 
			
		||||
    .usage('Usage: browserify [entry files] {OPTIONS}')
 | 
			
		||||
    .wrap(80)
 | 
			
		||||
    .option('outfile', {
 | 
			
		||||
        alias : 'o',
 | 
			
		||||
        desc : 'Write the browserify bundle to this file.\n'
 | 
			
		||||
            + 'If unspecified, browserify prints to stdout.'
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('require', {
 | 
			
		||||
        alias : 'r',
 | 
			
		||||
        desc : 'A module name or file to bundle.require()\n'
 | 
			
		||||
            + 'Optionally use a colon separator to set the target.'
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('entry', {
 | 
			
		||||
        alias : 'e',
 | 
			
		||||
        desc : 'An entry point of your app'
 | 
			
		||||
    })
 | 
			
		||||
    .option('exports', {
 | 
			
		||||
        desc : 'Export these core objects, comma-separated list\n'
 | 
			
		||||
            + 'with any of: require, process. If unspecified, the\n'
 | 
			
		||||
            + 'export behavior will be inferred.\n'
 | 
			
		||||
    })
 | 
			
		||||
    .option('ignore', {
 | 
			
		||||
        alias : 'i',
 | 
			
		||||
        desc : 'Ignore a file'
 | 
			
		||||
    })
 | 
			
		||||
    .option('alias', {
 | 
			
		||||
        alias : 'a',
 | 
			
		||||
        desc : 'Register an alias with a colon separator: "to:from"\n'
 | 
			
		||||
            + "Example: --alias 'jquery:jquery-browserify'"
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('cache', {
 | 
			
		||||
        alias : 'c',
 | 
			
		||||
        desc : 'Turn on caching at $HOME/.config/browserling/cache.json '
 | 
			
		||||
            + 'or use a file for caching.\n',
 | 
			
		||||
        default : true,
 | 
			
		||||
    })
 | 
			
		||||
    .option('debug', {
 | 
			
		||||
        alias : 'd',
 | 
			
		||||
        desc : 'Switch on debugging mode with //@ sourceURL=...s.',
 | 
			
		||||
        type : 'boolean'
 | 
			
		||||
    })
 | 
			
		||||
    .option('plugin', {
 | 
			
		||||
        alias : 'p',
 | 
			
		||||
        desc : 'Use a plugin.\n'
 | 
			
		||||
            + 'Example: --plugin aliasify'
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('prelude', {
 | 
			
		||||
        default : true,
 | 
			
		||||
        type : 'boolean',
 | 
			
		||||
        desc : 'Include the code that defines require() in this bundle.'
 | 
			
		||||
    })
 | 
			
		||||
    .option('watch', {
 | 
			
		||||
        alias : 'w',
 | 
			
		||||
        desc : 'Watch for changes. The script will stay open and write updates '
 | 
			
		||||
            + 'to the output every time any of the bundled files change.\n'
 | 
			
		||||
            + 'This option only works in tandem with -o.'
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('verbose', {
 | 
			
		||||
        alias : 'v',
 | 
			
		||||
        desc : 'Write out how many bytes were written in -o mode. '
 | 
			
		||||
            + 'This is especially useful with --watch.'
 | 
			
		||||
        ,
 | 
			
		||||
    })
 | 
			
		||||
    .option('help', {
 | 
			
		||||
        alias : 'h',
 | 
			
		||||
        desc : 'Show this message'
 | 
			
		||||
    })
 | 
			
		||||
    .check(function (argv) {
 | 
			
		||||
        if (argv.help) throw ''
 | 
			
		||||
        if (process.argv.length <= 2) throw 'Specify a parameter.'
 | 
			
		||||
    })
 | 
			
		||||
    .argv
 | 
			
		||||
;
 | 
			
		||||
 | 
			
		||||
var bundle = browserify({
 | 
			
		||||
    watch : argv.watch,
 | 
			
		||||
    cache : argv.cache,
 | 
			
		||||
    debug : argv.debug,
 | 
			
		||||
    exports : argv.exports && argv.exports.split(','),
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
bundle.on('syntaxError', function (err) {
 | 
			
		||||
    console.error(err);
 | 
			
		||||
    if (!argv.watch) {
 | 
			
		||||
        process.exit(1);
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
if (argv.noprelude || argv.prelude === false) {
 | 
			
		||||
    bundle.files = [];
 | 
			
		||||
    bundle.prepends = [];
 | 
			
		||||
}
 | 
			
		||||
if (argv.ignore) bundle.ignore(argv.ignore);
 | 
			
		||||
 | 
			
		||||
([].concat(argv.plugin || [])).forEach(function (plugin) {
 | 
			
		||||
    var resolved = resolve.sync(plugin, { basedir : process.cwd() });
 | 
			
		||||
    bundle.use(require(resolved));
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
([].concat(argv.alias || [])).forEach(function (alias) {
 | 
			
		||||
    if (!alias.match(/:/)) {
 | 
			
		||||
        console.error('aliases require a colon separator');
 | 
			
		||||
        process.exit();
 | 
			
		||||
    }
 | 
			
		||||
    bundle.alias.apply(bundle, alias.split(':'));
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
([].concat(argv.require || [])).forEach(function (req) {
 | 
			
		||||
    if (req.match(/:/)) {
 | 
			
		||||
        var s = req.split(':');
 | 
			
		||||
        bundle.require(s[0], { target : s[1] });
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (!/^[.\/]/.test(req)) {
 | 
			
		||||
        try {
 | 
			
		||||
            var res = resolve.sync(req, { basedir : process.cwd() });
 | 
			
		||||
        }
 | 
			
		||||
        catch (e) {
 | 
			
		||||
            return bundle.require(req);
 | 
			
		||||
        }
 | 
			
		||||
        return bundle.require(res, { target : req });
 | 
			
		||||
    }
 | 
			
		||||
    bundle.require(req);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
(argv._.concat(argv.entry || [])).forEach(function (entry) {
 | 
			
		||||
    bundle.addEntry(entry);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
if (argv.outfile) {
 | 
			
		||||
    function write () {
 | 
			
		||||
        var src = bundle.bundle();
 | 
			
		||||
        if (!bundle.ok) return;
 | 
			
		||||
        
 | 
			
		||||
        fs.writeFile(argv.outfile, src, function () {
 | 
			
		||||
            if (argv.verbose) {
 | 
			
		||||
                console.log(Buffer(src).length + ' bytes written');
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    write();
 | 
			
		||||
    if (argv.watch) bundle.on('bundle', write)
 | 
			
		||||
}
 | 
			
		||||
else {
 | 
			
		||||
    var src = bundle.bundle();
 | 
			
		||||
    if (bundle.ok) console.log(src);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										55
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/__browserify_process.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/__browserify_process.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
var process = module.exports = {};
 | 
			
		||||
 | 
			
		||||
process.nextTick = (function () {
 | 
			
		||||
    var canSetImmediate = typeof window !== 'undefined'
 | 
			
		||||
        && window.setImmediate;
 | 
			
		||||
    var canPost = typeof window !== 'undefined'
 | 
			
		||||
        && window.postMessage && window.addEventListener
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
    if (canSetImmediate) {
 | 
			
		||||
        return function (f) { return window.setImmediate(f) };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (canPost) {
 | 
			
		||||
        var queue = [];
 | 
			
		||||
        window.addEventListener('message', function (ev) {
 | 
			
		||||
            if (ev.source === window && ev.data === 'browserify-tick') {
 | 
			
		||||
                ev.stopPropagation();
 | 
			
		||||
                if (queue.length > 0) {
 | 
			
		||||
                    var fn = queue.shift();
 | 
			
		||||
                    fn();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }, true);
 | 
			
		||||
 | 
			
		||||
        return function nextTick(fn) {
 | 
			
		||||
            queue.push(fn);
 | 
			
		||||
            window.postMessage('browserify-tick', '*');
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return function nextTick(fn) {
 | 
			
		||||
        setTimeout(fn, 0);
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
process.title = 'browser';
 | 
			
		||||
process.browser = true;
 | 
			
		||||
process.env = {};
 | 
			
		||||
process.argv = [];
 | 
			
		||||
 | 
			
		||||
process.binding = function (name) {
 | 
			
		||||
    if (name === 'evals') return (require)('vm')
 | 
			
		||||
    else throw new Error('No such module. (Possibly not yet loaded)')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
(function () {
 | 
			
		||||
    var cwd = '/';
 | 
			
		||||
    var path;
 | 
			
		||||
    process.cwd = function () { return cwd };
 | 
			
		||||
    process.chdir = function (dir) {
 | 
			
		||||
        if (!path) path = require('path');
 | 
			
		||||
        cwd = path.resolve(dir, cwd);
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
							
								
								
									
										314
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/assert.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										314
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/assert.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,314 @@
 | 
			
		||||
// UTILITY
 | 
			
		||||
var util = require('util');
 | 
			
		||||
var Buffer = require("buffer").Buffer;
 | 
			
		||||
var pSlice = Array.prototype.slice;
 | 
			
		||||
 | 
			
		||||
function objectKeys(object) {
 | 
			
		||||
  if (Object.keys) return Object.keys(object);
 | 
			
		||||
  var result = [];
 | 
			
		||||
  for (var name in object) {
 | 
			
		||||
    if (Object.prototype.hasOwnProperty.call(object, name)) {
 | 
			
		||||
      result.push(name);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 1. The assert module provides functions that throw
 | 
			
		||||
// AssertionError's when particular conditions are not met. The
 | 
			
		||||
// assert module must conform to the following interface.
 | 
			
		||||
 | 
			
		||||
var assert = module.exports = ok;
 | 
			
		||||
 | 
			
		||||
// 2. The AssertionError is defined in assert.
 | 
			
		||||
// new assert.AssertionError({ message: message,
 | 
			
		||||
//                             actual: actual,
 | 
			
		||||
//                             expected: expected })
 | 
			
		||||
 | 
			
		||||
assert.AssertionError = function AssertionError(options) {
 | 
			
		||||
  this.name = 'AssertionError';
 | 
			
		||||
  this.message = options.message;
 | 
			
		||||
  this.actual = options.actual;
 | 
			
		||||
  this.expected = options.expected;
 | 
			
		||||
  this.operator = options.operator;
 | 
			
		||||
  var stackStartFunction = options.stackStartFunction || fail;
 | 
			
		||||
 | 
			
		||||
  if (Error.captureStackTrace) {
 | 
			
		||||
    Error.captureStackTrace(this, stackStartFunction);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
util.inherits(assert.AssertionError, Error);
 | 
			
		||||
 | 
			
		||||
function replacer(key, value) {
 | 
			
		||||
  if (value === undefined) {
 | 
			
		||||
    return '' + value;
 | 
			
		||||
  }
 | 
			
		||||
  if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) {
 | 
			
		||||
    return value.toString();
 | 
			
		||||
  }
 | 
			
		||||
  if (typeof value === 'function' || value instanceof RegExp) {
 | 
			
		||||
    return value.toString();
 | 
			
		||||
  }
 | 
			
		||||
  return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function truncate(s, n) {
 | 
			
		||||
  if (typeof s == 'string') {
 | 
			
		||||
    return s.length < n ? s : s.slice(0, n);
 | 
			
		||||
  } else {
 | 
			
		||||
    return s;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
assert.AssertionError.prototype.toString = function() {
 | 
			
		||||
  if (this.message) {
 | 
			
		||||
    return [this.name + ':', this.message].join(' ');
 | 
			
		||||
  } else {
 | 
			
		||||
    return [
 | 
			
		||||
      this.name + ':',
 | 
			
		||||
      truncate(JSON.stringify(this.actual, replacer), 128),
 | 
			
		||||
      this.operator,
 | 
			
		||||
      truncate(JSON.stringify(this.expected, replacer), 128)
 | 
			
		||||
    ].join(' ');
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// assert.AssertionError instanceof Error
 | 
			
		||||
 | 
			
		||||
assert.AssertionError.__proto__ = Error.prototype;
 | 
			
		||||
 | 
			
		||||
// At present only the three keys mentioned above are used and
 | 
			
		||||
// understood by the spec. Implementations or sub modules can pass
 | 
			
		||||
// other keys to the AssertionError's constructor - they will be
 | 
			
		||||
// ignored.
 | 
			
		||||
 | 
			
		||||
// 3. All of the following functions must throw an AssertionError
 | 
			
		||||
// when a corresponding condition is not met, with a message that
 | 
			
		||||
// may be undefined if not provided.  All assertion methods provide
 | 
			
		||||
// both the actual and expected values to the assertion error for
 | 
			
		||||
// display purposes.
 | 
			
		||||
 | 
			
		||||
function fail(actual, expected, message, operator, stackStartFunction) {
 | 
			
		||||
  throw new assert.AssertionError({
 | 
			
		||||
    message: message,
 | 
			
		||||
    actual: actual,
 | 
			
		||||
    expected: expected,
 | 
			
		||||
    operator: operator,
 | 
			
		||||
    stackStartFunction: stackStartFunction
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EXTENSION! allows for well behaved errors defined elsewhere.
 | 
			
		||||
assert.fail = fail;
 | 
			
		||||
 | 
			
		||||
// 4. Pure assertion tests whether a value is truthy, as determined
 | 
			
		||||
// by !!guard.
 | 
			
		||||
// assert.ok(guard, message_opt);
 | 
			
		||||
// This statement is equivalent to assert.equal(true, guard,
 | 
			
		||||
// message_opt);. To test strictly for the value true, use
 | 
			
		||||
// assert.strictEqual(true, guard, message_opt);.
 | 
			
		||||
 | 
			
		||||
function ok(value, message) {
 | 
			
		||||
  if (!!!value) fail(value, true, message, '==', assert.ok);
 | 
			
		||||
}
 | 
			
		||||
assert.ok = ok;
 | 
			
		||||
 | 
			
		||||
// 5. The equality assertion tests shallow, coercive equality with
 | 
			
		||||
// ==.
 | 
			
		||||
// assert.equal(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.equal = function equal(actual, expected, message) {
 | 
			
		||||
  if (actual != expected) fail(actual, expected, message, '==', assert.equal);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 6. The non-equality assertion tests for whether two objects are not equal
 | 
			
		||||
// with != assert.notEqual(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.notEqual = function notEqual(actual, expected, message) {
 | 
			
		||||
  if (actual == expected) {
 | 
			
		||||
    fail(actual, expected, message, '!=', assert.notEqual);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 7. The equivalence assertion tests a deep equality relation.
 | 
			
		||||
// assert.deepEqual(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.deepEqual = function deepEqual(actual, expected, message) {
 | 
			
		||||
  if (!_deepEqual(actual, expected)) {
 | 
			
		||||
    fail(actual, expected, message, 'deepEqual', assert.deepEqual);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function _deepEqual(actual, expected) {
 | 
			
		||||
  // 7.1. All identical values are equivalent, as determined by ===.
 | 
			
		||||
  if (actual === expected) {
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
 | 
			
		||||
    if (actual.length != expected.length) return false;
 | 
			
		||||
 | 
			
		||||
    for (var i = 0; i < actual.length; i++) {
 | 
			
		||||
      if (actual[i] !== expected[i]) return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  // 7.2. If the expected value is a Date object, the actual value is
 | 
			
		||||
  // equivalent if it is also a Date object that refers to the same time.
 | 
			
		||||
  } else if (actual instanceof Date && expected instanceof Date) {
 | 
			
		||||
    return actual.getTime() === expected.getTime();
 | 
			
		||||
 | 
			
		||||
  // 7.3. Other pairs that do not both pass typeof value == 'object',
 | 
			
		||||
  // equivalence is determined by ==.
 | 
			
		||||
  } else if (typeof actual != 'object' && typeof expected != 'object') {
 | 
			
		||||
    return actual == expected;
 | 
			
		||||
 | 
			
		||||
  // 7.4. For all other Object pairs, including Array objects, equivalence is
 | 
			
		||||
  // determined by having the same number of owned properties (as verified
 | 
			
		||||
  // with Object.prototype.hasOwnProperty.call), the same set of keys
 | 
			
		||||
  // (although not necessarily the same order), equivalent values for every
 | 
			
		||||
  // corresponding key, and an identical 'prototype' property. Note: this
 | 
			
		||||
  // accounts for both named and indexed properties on Arrays.
 | 
			
		||||
  } else {
 | 
			
		||||
    return objEquiv(actual, expected);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isUndefinedOrNull(value) {
 | 
			
		||||
  return value === null || value === undefined;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isArguments(object) {
 | 
			
		||||
  return Object.prototype.toString.call(object) == '[object Arguments]';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function objEquiv(a, b) {
 | 
			
		||||
  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
 | 
			
		||||
    return false;
 | 
			
		||||
  // an identical 'prototype' property.
 | 
			
		||||
  if (a.prototype !== b.prototype) return false;
 | 
			
		||||
  //~~~I've managed to break Object.keys through screwy arguments passing.
 | 
			
		||||
  //   Converting to array solves the problem.
 | 
			
		||||
  if (isArguments(a)) {
 | 
			
		||||
    if (!isArguments(b)) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    a = pSlice.call(a);
 | 
			
		||||
    b = pSlice.call(b);
 | 
			
		||||
    return _deepEqual(a, b);
 | 
			
		||||
  }
 | 
			
		||||
  try {
 | 
			
		||||
    var ka = objectKeys(a),
 | 
			
		||||
        kb = objectKeys(b),
 | 
			
		||||
        key, i;
 | 
			
		||||
  } catch (e) {//happens when one is a string literal and the other isn't
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
  // having the same number of owned properties (keys incorporates
 | 
			
		||||
  // hasOwnProperty)
 | 
			
		||||
  if (ka.length != kb.length)
 | 
			
		||||
    return false;
 | 
			
		||||
  //the same set of keys (although not necessarily the same order),
 | 
			
		||||
  ka.sort();
 | 
			
		||||
  kb.sort();
 | 
			
		||||
  //~~~cheap key test
 | 
			
		||||
  for (i = ka.length - 1; i >= 0; i--) {
 | 
			
		||||
    if (ka[i] != kb[i])
 | 
			
		||||
      return false;
 | 
			
		||||
  }
 | 
			
		||||
  //equivalent values for every corresponding key, and
 | 
			
		||||
  //~~~possibly expensive deep test
 | 
			
		||||
  for (i = ka.length - 1; i >= 0; i--) {
 | 
			
		||||
    key = ka[i];
 | 
			
		||||
    if (!_deepEqual(a[key], b[key])) return false;
 | 
			
		||||
  }
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 8. The non-equivalence assertion tests for any deep inequality.
 | 
			
		||||
// assert.notDeepEqual(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
 | 
			
		||||
  if (_deepEqual(actual, expected)) {
 | 
			
		||||
    fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 9. The strict equality assertion tests strict equality, as determined by ===.
 | 
			
		||||
// assert.strictEqual(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.strictEqual = function strictEqual(actual, expected, message) {
 | 
			
		||||
  if (actual !== expected) {
 | 
			
		||||
    fail(actual, expected, message, '===', assert.strictEqual);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 10. The strict non-equality assertion tests for strict inequality, as
 | 
			
		||||
// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
 | 
			
		||||
  if (actual === expected) {
 | 
			
		||||
    fail(actual, expected, message, '!==', assert.notStrictEqual);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function expectedException(actual, expected) {
 | 
			
		||||
  if (!actual || !expected) {
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (expected instanceof RegExp) {
 | 
			
		||||
    return expected.test(actual);
 | 
			
		||||
  } else if (actual instanceof expected) {
 | 
			
		||||
    return true;
 | 
			
		||||
  } else if (expected.call({}, actual) === true) {
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _throws(shouldThrow, block, expected, message) {
 | 
			
		||||
  var actual;
 | 
			
		||||
 | 
			
		||||
  if (typeof expected === 'string') {
 | 
			
		||||
    message = expected;
 | 
			
		||||
    expected = null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  try {
 | 
			
		||||
    block();
 | 
			
		||||
  } catch (e) {
 | 
			
		||||
    actual = e;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
 | 
			
		||||
            (message ? ' ' + message : '.');
 | 
			
		||||
 | 
			
		||||
  if (shouldThrow && !actual) {
 | 
			
		||||
    fail('Missing expected exception' + message);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!shouldThrow && expectedException(actual, expected)) {
 | 
			
		||||
    fail('Got unwanted exception' + message);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if ((shouldThrow && actual && expected &&
 | 
			
		||||
      !expectedException(actual, expected)) || (!shouldThrow && actual)) {
 | 
			
		||||
    throw actual;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 11. Expected to throw an error:
 | 
			
		||||
// assert.throws(block, Error_opt, message_opt);
 | 
			
		||||
 | 
			
		||||
assert.throws = function(block, /*optional*/error, /*optional*/message) {
 | 
			
		||||
  _throws.apply(this, [true].concat(pSlice.call(arguments)));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// EXTENSION! This is annoying to write outside this module.
 | 
			
		||||
assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
 | 
			
		||||
  _throws.apply(this, [false].concat(pSlice.call(arguments)));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
assert.ifError = function(err) { if (err) {throw err;}};
 | 
			
		||||
							
								
								
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/child_process.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/child_process.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
exports.spawn = function () {};
 | 
			
		||||
exports.exec = function () {};
 | 
			
		||||
							
								
								
									
										178
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/events.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/events.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,178 @@
 | 
			
		||||
if (!process.EventEmitter) process.EventEmitter = function () {};
 | 
			
		||||
 | 
			
		||||
var EventEmitter = exports.EventEmitter = process.EventEmitter;
 | 
			
		||||
var isArray = typeof Array.isArray === 'function'
 | 
			
		||||
    ? Array.isArray
 | 
			
		||||
    : function (xs) {
 | 
			
		||||
        return Object.prototype.toString.call(xs) === '[object Array]'
 | 
			
		||||
    }
 | 
			
		||||
;
 | 
			
		||||
function indexOf (xs, x) {
 | 
			
		||||
    if (xs.indexOf) return xs.indexOf(x);
 | 
			
		||||
    for (var i = 0; i < xs.length; i++) {
 | 
			
		||||
        if (x === xs[i]) return i;
 | 
			
		||||
    }
 | 
			
		||||
    return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// By default EventEmitters will print a warning if more than
 | 
			
		||||
// 10 listeners are added to it. This is a useful default which
 | 
			
		||||
// helps finding memory leaks.
 | 
			
		||||
//
 | 
			
		||||
// Obviously not all Emitters should be limited to 10. This function allows
 | 
			
		||||
// that to be increased. Set to zero for unlimited.
 | 
			
		||||
var defaultMaxListeners = 10;
 | 
			
		||||
EventEmitter.prototype.setMaxListeners = function(n) {
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
  this._events.maxListeners = n;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.emit = function(type) {
 | 
			
		||||
  // If there is no 'error' event listener then throw.
 | 
			
		||||
  if (type === 'error') {
 | 
			
		||||
    if (!this._events || !this._events.error ||
 | 
			
		||||
        (isArray(this._events.error) && !this._events.error.length))
 | 
			
		||||
    {
 | 
			
		||||
      if (arguments[1] instanceof Error) {
 | 
			
		||||
        throw arguments[1]; // Unhandled 'error' event
 | 
			
		||||
      } else {
 | 
			
		||||
        throw new Error("Uncaught, unspecified 'error' event.");
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!this._events) return false;
 | 
			
		||||
  var handler = this._events[type];
 | 
			
		||||
  if (!handler) return false;
 | 
			
		||||
 | 
			
		||||
  if (typeof handler == 'function') {
 | 
			
		||||
    switch (arguments.length) {
 | 
			
		||||
      // fast cases
 | 
			
		||||
      case 1:
 | 
			
		||||
        handler.call(this);
 | 
			
		||||
        break;
 | 
			
		||||
      case 2:
 | 
			
		||||
        handler.call(this, arguments[1]);
 | 
			
		||||
        break;
 | 
			
		||||
      case 3:
 | 
			
		||||
        handler.call(this, arguments[1], arguments[2]);
 | 
			
		||||
        break;
 | 
			
		||||
      // slower
 | 
			
		||||
      default:
 | 
			
		||||
        var args = Array.prototype.slice.call(arguments, 1);
 | 
			
		||||
        handler.apply(this, args);
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  } else if (isArray(handler)) {
 | 
			
		||||
    var args = Array.prototype.slice.call(arguments, 1);
 | 
			
		||||
 | 
			
		||||
    var listeners = handler.slice();
 | 
			
		||||
    for (var i = 0, l = listeners.length; i < l; i++) {
 | 
			
		||||
      listeners[i].apply(this, args);
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  } else {
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// EventEmitter is defined in src/node_events.cc
 | 
			
		||||
// EventEmitter.prototype.emit() is also defined there.
 | 
			
		||||
EventEmitter.prototype.addListener = function(type, listener) {
 | 
			
		||||
  if ('function' !== typeof listener) {
 | 
			
		||||
    throw new Error('addListener only takes instances of Function');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
 | 
			
		||||
  // To avoid recursion in the case that type == "newListeners"! Before
 | 
			
		||||
  // adding it to the listeners, first emit "newListeners".
 | 
			
		||||
  this.emit('newListener', type, listener);
 | 
			
		||||
 | 
			
		||||
  if (!this._events[type]) {
 | 
			
		||||
    // Optimize the case of one listener. Don't need the extra array object.
 | 
			
		||||
    this._events[type] = listener;
 | 
			
		||||
  } else if (isArray(this._events[type])) {
 | 
			
		||||
 | 
			
		||||
    // Check for listener leak
 | 
			
		||||
    if (!this._events[type].warned) {
 | 
			
		||||
      var m;
 | 
			
		||||
      if (this._events.maxListeners !== undefined) {
 | 
			
		||||
        m = this._events.maxListeners;
 | 
			
		||||
      } else {
 | 
			
		||||
        m = defaultMaxListeners;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (m && m > 0 && this._events[type].length > m) {
 | 
			
		||||
        this._events[type].warned = true;
 | 
			
		||||
        console.error('(node) warning: possible EventEmitter memory ' +
 | 
			
		||||
                      'leak detected. %d listeners added. ' +
 | 
			
		||||
                      'Use emitter.setMaxListeners() to increase limit.',
 | 
			
		||||
                      this._events[type].length);
 | 
			
		||||
        console.trace();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // If we've already got an array, just append.
 | 
			
		||||
    this._events[type].push(listener);
 | 
			
		||||
  } else {
 | 
			
		||||
    // Adding the second element, need to change to array.
 | 
			
		||||
    this._events[type] = [this._events[type], listener];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.once = function(type, listener) {
 | 
			
		||||
  var self = this;
 | 
			
		||||
  self.on(type, function g() {
 | 
			
		||||
    self.removeListener(type, g);
 | 
			
		||||
    listener.apply(this, arguments);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.removeListener = function(type, listener) {
 | 
			
		||||
  if ('function' !== typeof listener) {
 | 
			
		||||
    throw new Error('removeListener only takes instances of Function');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // does not use listeners(), so no side effect of creating _events[type]
 | 
			
		||||
  if (!this._events || !this._events[type]) return this;
 | 
			
		||||
 | 
			
		||||
  var list = this._events[type];
 | 
			
		||||
 | 
			
		||||
  if (isArray(list)) {
 | 
			
		||||
    var i = indexOf(list, listener);
 | 
			
		||||
    if (i < 0) return this;
 | 
			
		||||
    list.splice(i, 1);
 | 
			
		||||
    if (list.length == 0)
 | 
			
		||||
      delete this._events[type];
 | 
			
		||||
  } else if (this._events[type] === listener) {
 | 
			
		||||
    delete this._events[type];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.removeAllListeners = function(type) {
 | 
			
		||||
  // does not use listeners(), so no side effect of creating _events[type]
 | 
			
		||||
  if (type && this._events && this._events[type]) this._events[type] = null;
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.listeners = function(type) {
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
  if (!this._events[type]) this._events[type] = [];
 | 
			
		||||
  if (!isArray(this._events[type])) {
 | 
			
		||||
    this._events[type] = [this._events[type]];
 | 
			
		||||
  }
 | 
			
		||||
  return this._events[type];
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/fs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/fs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
// nothing to see here... no file methods for the browser
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/https.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/https.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('http');
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/net.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/net.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
// todo
 | 
			
		||||
							
								
								
									
										175
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/path.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										175
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/path.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,175 @@
 | 
			
		||||
function filter (xs, fn) {
 | 
			
		||||
    var res = [];
 | 
			
		||||
    for (var i = 0; i < xs.length; i++) {
 | 
			
		||||
        if (fn(xs[i], i, xs)) res.push(xs[i]);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// resolves . and .. elements in a path array with directory names there
 | 
			
		||||
// must be no slashes, empty elements, or device names (c:\) in the array
 | 
			
		||||
// (so also no leading and trailing slashes - it does not distinguish
 | 
			
		||||
// relative and absolute paths)
 | 
			
		||||
function normalizeArray(parts, allowAboveRoot) {
 | 
			
		||||
  // if the path tries to go above the root, `up` ends up > 0
 | 
			
		||||
  var up = 0;
 | 
			
		||||
  for (var i = parts.length; i >= 0; i--) {
 | 
			
		||||
    var last = parts[i];
 | 
			
		||||
    if (last == '.') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
    } else if (last === '..') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up++;
 | 
			
		||||
    } else if (up) {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up--;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // if the path is allowed to go above the root, restore leading ..s
 | 
			
		||||
  if (allowAboveRoot) {
 | 
			
		||||
    for (; up--; up) {
 | 
			
		||||
      parts.unshift('..');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return parts;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Regex to split a filename into [*, dir, basename, ext]
 | 
			
		||||
// posix version
 | 
			
		||||
var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
 | 
			
		||||
 | 
			
		||||
// path.resolve([from ...], to)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.resolve = function() {
 | 
			
		||||
var resolvedPath = '',
 | 
			
		||||
    resolvedAbsolute = false;
 | 
			
		||||
 | 
			
		||||
for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
 | 
			
		||||
  var path = (i >= 0)
 | 
			
		||||
      ? arguments[i]
 | 
			
		||||
      : process.cwd();
 | 
			
		||||
 | 
			
		||||
  // Skip empty and invalid entries
 | 
			
		||||
  if (typeof path !== 'string' || !path) {
 | 
			
		||||
    continue;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  resolvedPath = path + '/' + resolvedPath;
 | 
			
		||||
  resolvedAbsolute = path.charAt(0) === '/';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// At this point the path should be resolved to a full absolute path, but
 | 
			
		||||
// handle relative paths to be safe (might happen when process.cwd() fails)
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !resolvedAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// path.normalize(path)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.normalize = function(path) {
 | 
			
		||||
var isAbsolute = path.charAt(0) === '/',
 | 
			
		||||
    trailingSlash = path.slice(-1) === '/';
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
path = normalizeArray(filter(path.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !isAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  if (!path && !isAbsolute) {
 | 
			
		||||
    path = '.';
 | 
			
		||||
  }
 | 
			
		||||
  if (path && trailingSlash) {
 | 
			
		||||
    path += '/';
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  return (isAbsolute ? '/' : '') + path;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// posix version
 | 
			
		||||
exports.join = function() {
 | 
			
		||||
  var paths = Array.prototype.slice.call(arguments, 0);
 | 
			
		||||
  return exports.normalize(filter(paths, function(p, index) {
 | 
			
		||||
    return p && typeof p === 'string';
 | 
			
		||||
  }).join('/'));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.dirname = function(path) {
 | 
			
		||||
  var dir = splitPathRe.exec(path)[1] || '';
 | 
			
		||||
  var isWindows = false;
 | 
			
		||||
  if (!dir) {
 | 
			
		||||
    // No dirname
 | 
			
		||||
    return '.';
 | 
			
		||||
  } else if (dir.length === 1 ||
 | 
			
		||||
      (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
 | 
			
		||||
    // It is just a slash or a drive letter with a slash
 | 
			
		||||
    return dir;
 | 
			
		||||
  } else {
 | 
			
		||||
    // It is a full dirname, strip trailing slash
 | 
			
		||||
    return dir.substring(0, dir.length - 1);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.basename = function(path, ext) {
 | 
			
		||||
  var f = splitPathRe.exec(path)[2] || '';
 | 
			
		||||
  // TODO: make this comparison case-insensitive on windows?
 | 
			
		||||
  if (ext && f.substr(-1 * ext.length) === ext) {
 | 
			
		||||
    f = f.substr(0, f.length - ext.length);
 | 
			
		||||
  }
 | 
			
		||||
  return f;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.extname = function(path) {
 | 
			
		||||
  return splitPathRe.exec(path)[3] || '';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.relative = function(from, to) {
 | 
			
		||||
  from = exports.resolve(from).substr(1);
 | 
			
		||||
  to = exports.resolve(to).substr(1);
 | 
			
		||||
 | 
			
		||||
  function trim(arr) {
 | 
			
		||||
    var start = 0;
 | 
			
		||||
    for (; start < arr.length; start++) {
 | 
			
		||||
      if (arr[start] !== '') break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var end = arr.length - 1;
 | 
			
		||||
    for (; end >= 0; end--) {
 | 
			
		||||
      if (arr[end] !== '') break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (start > end) return [];
 | 
			
		||||
    return arr.slice(start, end - start + 1);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var fromParts = trim(from.split('/'));
 | 
			
		||||
  var toParts = trim(to.split('/'));
 | 
			
		||||
 | 
			
		||||
  var length = Math.min(fromParts.length, toParts.length);
 | 
			
		||||
  var samePartsLength = length;
 | 
			
		||||
  for (var i = 0; i < length; i++) {
 | 
			
		||||
    if (fromParts[i] !== toParts[i]) {
 | 
			
		||||
      samePartsLength = i;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var outputParts = [];
 | 
			
		||||
  for (var i = samePartsLength; i < fromParts.length; i++) {
 | 
			
		||||
    outputParts.push('..');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  outputParts = outputParts.concat(toParts.slice(samePartsLength));
 | 
			
		||||
 | 
			
		||||
  return outputParts.join('/');
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										250
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/querystring.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										250
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/querystring.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,250 @@
 | 
			
		||||
var isArray = typeof Array.isArray === 'function'
 | 
			
		||||
    ? Array.isArray
 | 
			
		||||
    : function (xs) {
 | 
			
		||||
        return Object.prototype.toString.call(xs) === '[object Array]'
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
var objectKeys = Object.keys || function objectKeys(object) {
 | 
			
		||||
    if (object !== Object(object)) throw new TypeError('Invalid object');
 | 
			
		||||
    var keys = [];
 | 
			
		||||
    for (var key in object) if (object.hasOwnProperty(key)) keys[keys.length] = key;
 | 
			
		||||
    return keys;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * querystring
 | 
			
		||||
 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
 | 
			
		||||
 * MIT Licensed
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Library version.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
exports.version = '0.3.1';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Object#toString() ref for stringify().
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var toString = Object.prototype.toString;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Cache non-integer test regexp.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var notint = /[^0-9]/;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse the given query `str`, returning an object.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} str
 | 
			
		||||
 * @return {Object}
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
exports.parse = function(str){
 | 
			
		||||
  if (null == str || '' == str) return {};
 | 
			
		||||
 | 
			
		||||
  function promote(parent, key) {
 | 
			
		||||
    if (parent[key].length == 0) return parent[key] = {};
 | 
			
		||||
    var t = {};
 | 
			
		||||
    for (var i in parent[key]) t[i] = parent[key][i];
 | 
			
		||||
    parent[key] = t;
 | 
			
		||||
    return t;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return String(str)
 | 
			
		||||
    .split('&')
 | 
			
		||||
    .reduce(function(ret, pair){
 | 
			
		||||
      try{ 
 | 
			
		||||
        pair = decodeURIComponent(pair.replace(/\+/g, ' '));
 | 
			
		||||
      } catch(e) {
 | 
			
		||||
        // ignore
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var eql = pair.indexOf('=')
 | 
			
		||||
        , brace = lastBraceInKey(pair)
 | 
			
		||||
        , key = pair.substr(0, brace || eql)
 | 
			
		||||
        , val = pair.substr(brace || eql, pair.length)
 | 
			
		||||
        , val = val.substr(val.indexOf('=') + 1, val.length)
 | 
			
		||||
        , parent = ret;
 | 
			
		||||
 | 
			
		||||
      // ?foo
 | 
			
		||||
      if ('' == key) key = pair, val = '';
 | 
			
		||||
 | 
			
		||||
      // nested
 | 
			
		||||
      if (~key.indexOf(']')) {
 | 
			
		||||
        var parts = key.split('[')
 | 
			
		||||
          , len = parts.length
 | 
			
		||||
          , last = len - 1;
 | 
			
		||||
 | 
			
		||||
        function parse(parts, parent, key) {
 | 
			
		||||
          var part = parts.shift();
 | 
			
		||||
 | 
			
		||||
          // end
 | 
			
		||||
          if (!part) {
 | 
			
		||||
            if (isArray(parent[key])) {
 | 
			
		||||
              parent[key].push(val);
 | 
			
		||||
            } else if ('object' == typeof parent[key]) {
 | 
			
		||||
              parent[key] = val;
 | 
			
		||||
            } else if ('undefined' == typeof parent[key]) {
 | 
			
		||||
              parent[key] = val;
 | 
			
		||||
            } else {
 | 
			
		||||
              parent[key] = [parent[key], val];
 | 
			
		||||
            }
 | 
			
		||||
          // array
 | 
			
		||||
          } else {
 | 
			
		||||
            obj = parent[key] = parent[key] || [];
 | 
			
		||||
            if (']' == part) {
 | 
			
		||||
              if (isArray(obj)) {
 | 
			
		||||
                if ('' != val) obj.push(val);
 | 
			
		||||
              } else if ('object' == typeof obj) {
 | 
			
		||||
                obj[objectKeys(obj).length] = val;
 | 
			
		||||
              } else {
 | 
			
		||||
                obj = parent[key] = [parent[key], val];
 | 
			
		||||
              }
 | 
			
		||||
            // prop
 | 
			
		||||
            } else if (~part.indexOf(']')) {
 | 
			
		||||
              part = part.substr(0, part.length - 1);
 | 
			
		||||
              if(notint.test(part) && isArray(obj)) obj = promote(parent, key);
 | 
			
		||||
              parse(parts, obj, part);
 | 
			
		||||
            // key
 | 
			
		||||
            } else {
 | 
			
		||||
              if(notint.test(part) && isArray(obj)) obj = promote(parent, key);
 | 
			
		||||
              parse(parts, obj, part);
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        parse(parts, parent, 'base');
 | 
			
		||||
      // optimize
 | 
			
		||||
      } else {
 | 
			
		||||
        if (notint.test(key) && isArray(parent.base)) {
 | 
			
		||||
          var t = {};
 | 
			
		||||
          for(var k in parent.base) t[k] = parent.base[k];
 | 
			
		||||
          parent.base = t;
 | 
			
		||||
        }
 | 
			
		||||
        set(parent.base, key, val);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return ret;
 | 
			
		||||
    }, {base: {}}).base;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Turn the given `obj` into a query string
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Object} obj
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var stringify = exports.stringify = function(obj, prefix) {
 | 
			
		||||
  if (isArray(obj)) {
 | 
			
		||||
    return stringifyArray(obj, prefix);
 | 
			
		||||
  } else if ('[object Object]' == toString.call(obj)) {
 | 
			
		||||
    return stringifyObject(obj, prefix);
 | 
			
		||||
  } else if ('string' == typeof obj) {
 | 
			
		||||
    return stringifyString(obj, prefix);
 | 
			
		||||
  } else {
 | 
			
		||||
    return prefix;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Stringify the given `str`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} str
 | 
			
		||||
 * @param {String} prefix
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function stringifyString(str, prefix) {
 | 
			
		||||
  if (!prefix) throw new TypeError('stringify expects an object');
 | 
			
		||||
  return prefix + '=' + encodeURIComponent(str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Stringify the given `arr`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Array} arr
 | 
			
		||||
 * @param {String} prefix
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function stringifyArray(arr, prefix) {
 | 
			
		||||
  var ret = [];
 | 
			
		||||
  if (!prefix) throw new TypeError('stringify expects an object');
 | 
			
		||||
  for (var i = 0; i < arr.length; i++) {
 | 
			
		||||
    ret.push(stringify(arr[i], prefix + '[]'));
 | 
			
		||||
  }
 | 
			
		||||
  return ret.join('&');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Stringify the given `obj`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Object} obj
 | 
			
		||||
 * @param {String} prefix
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function stringifyObject(obj, prefix) {
 | 
			
		||||
  var ret = []
 | 
			
		||||
    , keys = objectKeys(obj)
 | 
			
		||||
    , key;
 | 
			
		||||
  for (var i = 0, len = keys.length; i < len; ++i) {
 | 
			
		||||
    key = keys[i];
 | 
			
		||||
    ret.push(stringify(obj[key], prefix
 | 
			
		||||
      ? prefix + '[' + encodeURIComponent(key) + ']'
 | 
			
		||||
      : encodeURIComponent(key)));
 | 
			
		||||
  }
 | 
			
		||||
  return ret.join('&');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set `obj`'s `key` to `val` respecting
 | 
			
		||||
 * the weird and wonderful syntax of a qs,
 | 
			
		||||
 * where "foo=bar&foo=baz" becomes an array.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Object} obj
 | 
			
		||||
 * @param {String} key
 | 
			
		||||
 * @param {String} val
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function set(obj, key, val) {
 | 
			
		||||
  var v = obj[key];
 | 
			
		||||
  if (undefined === v) {
 | 
			
		||||
    obj[key] = val;
 | 
			
		||||
  } else if (isArray(v)) {
 | 
			
		||||
    v.push(val);
 | 
			
		||||
  } else {
 | 
			
		||||
    obj[key] = [v, val];
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Locate last brace in `str` within the key.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} str
 | 
			
		||||
 * @return {Number}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function lastBraceInKey(str) {
 | 
			
		||||
  var len = str.length
 | 
			
		||||
    , brace
 | 
			
		||||
    , c;
 | 
			
		||||
  for (var i = 0; i < len; ++i) {
 | 
			
		||||
    c = str[i];
 | 
			
		||||
    if (']' == c) brace = false;
 | 
			
		||||
    if ('[' == c) brace = true;
 | 
			
		||||
    if ('=' == c && !brace) return i;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										119
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/stream.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										119
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/stream.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,119 @@
 | 
			
		||||
var events = require('events');
 | 
			
		||||
var util = require('util');
 | 
			
		||||
 | 
			
		||||
function Stream() {
 | 
			
		||||
  events.EventEmitter.call(this);
 | 
			
		||||
}
 | 
			
		||||
util.inherits(Stream, events.EventEmitter);
 | 
			
		||||
module.exports = Stream;
 | 
			
		||||
// Backwards-compat with node 0.4.x
 | 
			
		||||
Stream.Stream = Stream;
 | 
			
		||||
 | 
			
		||||
Stream.prototype.pipe = function(dest, options) {
 | 
			
		||||
  var source = this;
 | 
			
		||||
 | 
			
		||||
  function ondata(chunk) {
 | 
			
		||||
    if (dest.writable) {
 | 
			
		||||
      if (false === dest.write(chunk) && source.pause) {
 | 
			
		||||
        source.pause();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source.on('data', ondata);
 | 
			
		||||
 | 
			
		||||
  function ondrain() {
 | 
			
		||||
    if (source.readable && source.resume) {
 | 
			
		||||
      source.resume();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  dest.on('drain', ondrain);
 | 
			
		||||
 | 
			
		||||
  // If the 'end' option is not supplied, dest.end() will be called when
 | 
			
		||||
  // source gets the 'end' or 'close' events.  Only dest.end() once, and
 | 
			
		||||
  // only when all sources have ended.
 | 
			
		||||
  if (!dest._isStdio && (!options || options.end !== false)) {
 | 
			
		||||
    dest._pipeCount = dest._pipeCount || 0;
 | 
			
		||||
    dest._pipeCount++;
 | 
			
		||||
 | 
			
		||||
    source.on('end', onend);
 | 
			
		||||
    source.on('close', onclose);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var didOnEnd = false;
 | 
			
		||||
  function onend() {
 | 
			
		||||
    if (didOnEnd) return;
 | 
			
		||||
    didOnEnd = true;
 | 
			
		||||
 | 
			
		||||
    dest._pipeCount--;
 | 
			
		||||
 | 
			
		||||
    // remove the listeners
 | 
			
		||||
    cleanup();
 | 
			
		||||
 | 
			
		||||
    if (dest._pipeCount > 0) {
 | 
			
		||||
      // waiting for other incoming streams to end.
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    dest.end();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  function onclose() {
 | 
			
		||||
    if (didOnEnd) return;
 | 
			
		||||
    didOnEnd = true;
 | 
			
		||||
 | 
			
		||||
    dest._pipeCount--;
 | 
			
		||||
 | 
			
		||||
    // remove the listeners
 | 
			
		||||
    cleanup();
 | 
			
		||||
 | 
			
		||||
    if (dest._pipeCount > 0) {
 | 
			
		||||
      // waiting for other incoming streams to end.
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    dest.destroy();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // don't leave dangling pipes when there are errors.
 | 
			
		||||
  function onerror(er) {
 | 
			
		||||
    cleanup();
 | 
			
		||||
    if (this.listeners('error').length === 0) {
 | 
			
		||||
      throw er; // Unhandled stream error in pipe.
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source.on('error', onerror);
 | 
			
		||||
  dest.on('error', onerror);
 | 
			
		||||
 | 
			
		||||
  // remove all the event listeners that were added.
 | 
			
		||||
  function cleanup() {
 | 
			
		||||
    source.removeListener('data', ondata);
 | 
			
		||||
    dest.removeListener('drain', ondrain);
 | 
			
		||||
 | 
			
		||||
    source.removeListener('end', onend);
 | 
			
		||||
    source.removeListener('close', onclose);
 | 
			
		||||
 | 
			
		||||
    source.removeListener('error', onerror);
 | 
			
		||||
    dest.removeListener('error', onerror);
 | 
			
		||||
 | 
			
		||||
    source.removeListener('end', cleanup);
 | 
			
		||||
    source.removeListener('close', cleanup);
 | 
			
		||||
 | 
			
		||||
    dest.removeListener('end', cleanup);
 | 
			
		||||
    dest.removeListener('close', cleanup);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source.on('end', cleanup);
 | 
			
		||||
  source.on('close', cleanup);
 | 
			
		||||
 | 
			
		||||
  dest.on('end', cleanup);
 | 
			
		||||
  dest.on('close', cleanup);
 | 
			
		||||
 | 
			
		||||
  dest.emit('pipe', source);
 | 
			
		||||
 | 
			
		||||
  // Allow for unix-like usage: A.pipe(B).pipe(C)
 | 
			
		||||
  return dest;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										161
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/string_decoder.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										161
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/string_decoder.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,161 @@
 | 
			
		||||
var StringDecoder = exports.StringDecoder = function(encoding) {
 | 
			
		||||
  this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
 | 
			
		||||
  switch (this.encoding) {
 | 
			
		||||
    case 'utf8':
 | 
			
		||||
      // CESU-8 represents each of Surrogate Pair by 3-bytes
 | 
			
		||||
      this.surrogateSize = 3;
 | 
			
		||||
      break;
 | 
			
		||||
    case 'ucs2':
 | 
			
		||||
    case 'utf16le':
 | 
			
		||||
      // UTF-16 represents each of Surrogate Pair by 2-bytes
 | 
			
		||||
      this.surrogateSize = 2;
 | 
			
		||||
      this.detectIncompleteChar = utf16DetectIncompleteChar;
 | 
			
		||||
      break;
 | 
			
		||||
    case 'base64':
 | 
			
		||||
      // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
 | 
			
		||||
      this.surrogateSize = 3;
 | 
			
		||||
      this.detectIncompleteChar = base64DetectIncompleteChar;
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      this.write = passThroughWrite;
 | 
			
		||||
      return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  this.charBuffer = new Buffer(6);
 | 
			
		||||
  this.charReceived = 0;
 | 
			
		||||
  this.charLength = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
StringDecoder.prototype.write = function(buffer) {
 | 
			
		||||
  var charStr = '';
 | 
			
		||||
  var offset = 0;
 | 
			
		||||
 | 
			
		||||
  // if our last write ended with an incomplete multibyte character
 | 
			
		||||
  while (this.charLength) {
 | 
			
		||||
    // determine how many remaining bytes this buffer has to offer for this char
 | 
			
		||||
    var i = (buffer.length >= this.charLength - this.charReceived) ?
 | 
			
		||||
                this.charLength - this.charReceived :
 | 
			
		||||
                buffer.length;
 | 
			
		||||
 | 
			
		||||
    // add the new bytes to the char buffer
 | 
			
		||||
    buffer.copy(this.charBuffer, this.charReceived, offset, i);
 | 
			
		||||
    this.charReceived += (i - offset);
 | 
			
		||||
    offset = i;
 | 
			
		||||
 | 
			
		||||
    if (this.charReceived < this.charLength) {
 | 
			
		||||
      // still not enough chars in this buffer? wait for more ...
 | 
			
		||||
      return '';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // get the character that was split
 | 
			
		||||
    charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
 | 
			
		||||
 | 
			
		||||
    // lead surrogate (D800-DBFF) is also the incomplete character
 | 
			
		||||
    var charCode = charStr.charCodeAt(charStr.length - 1);
 | 
			
		||||
    if (charCode >= 0xD800 && charCode <= 0xDBFF) {
 | 
			
		||||
      this.charLength += this.surrogateSize;
 | 
			
		||||
      charStr = '';
 | 
			
		||||
      continue;
 | 
			
		||||
    }
 | 
			
		||||
    this.charReceived = this.charLength = 0;
 | 
			
		||||
 | 
			
		||||
    // if there are no more bytes in this buffer, just emit our char
 | 
			
		||||
    if (i == buffer.length) return charStr;
 | 
			
		||||
 | 
			
		||||
    // otherwise cut off the characters end from the beginning of this buffer
 | 
			
		||||
    buffer = buffer.slice(i, buffer.length);
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var lenIncomplete = this.detectIncompleteChar(buffer);
 | 
			
		||||
 | 
			
		||||
  var end = buffer.length;
 | 
			
		||||
  if (this.charLength) {
 | 
			
		||||
    // buffer the incomplete character bytes we got
 | 
			
		||||
    buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end);
 | 
			
		||||
    this.charReceived = lenIncomplete;
 | 
			
		||||
    end -= lenIncomplete;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  charStr += buffer.toString(this.encoding, 0, end);
 | 
			
		||||
 | 
			
		||||
  var end = charStr.length - 1;
 | 
			
		||||
  var charCode = charStr.charCodeAt(end);
 | 
			
		||||
  // lead surrogate (D800-DBFF) is also the incomplete character
 | 
			
		||||
  if (charCode >= 0xD800 && charCode <= 0xDBFF) {
 | 
			
		||||
    var size = this.surrogateSize;
 | 
			
		||||
    this.charLength += size;
 | 
			
		||||
    this.charReceived += size;
 | 
			
		||||
    this.charBuffer.copy(this.charBuffer, size, 0, size);
 | 
			
		||||
    this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding);
 | 
			
		||||
    return charStr.substring(0, end);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // or just emit the charStr
 | 
			
		||||
  return charStr;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
StringDecoder.prototype.detectIncompleteChar = function(buffer) {
 | 
			
		||||
  // determine how many bytes we have to check at the end of this buffer
 | 
			
		||||
  var i = (buffer.length >= 3) ? 3 : buffer.length;
 | 
			
		||||
 | 
			
		||||
  // Figure out if one of the last i bytes of our buffer announces an
 | 
			
		||||
  // incomplete char.
 | 
			
		||||
  for (; i > 0; i--) {
 | 
			
		||||
    var c = buffer[buffer.length - i];
 | 
			
		||||
 | 
			
		||||
    // See http://en.wikipedia.org/wiki/UTF-8#Description
 | 
			
		||||
 | 
			
		||||
    // 110XXXXX
 | 
			
		||||
    if (i == 1 && c >> 5 == 0x06) {
 | 
			
		||||
      this.charLength = 2;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 1110XXXX
 | 
			
		||||
    if (i <= 2 && c >> 4 == 0x0E) {
 | 
			
		||||
      this.charLength = 3;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 11110XXX
 | 
			
		||||
    if (i <= 3 && c >> 3 == 0x1E) {
 | 
			
		||||
      this.charLength = 4;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return i;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
StringDecoder.prototype.end = function(buffer) {
 | 
			
		||||
  var res = '';
 | 
			
		||||
  if (buffer && buffer.length)
 | 
			
		||||
    res = this.write(buffer);
 | 
			
		||||
 | 
			
		||||
  if (this.charReceived) {
 | 
			
		||||
    var cr = this.charReceived;
 | 
			
		||||
    var buf = this.charBuffer;
 | 
			
		||||
    var enc = this.encoding;
 | 
			
		||||
    res += buf.slice(0, cr).toString(enc);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function passThroughWrite(buffer) {
 | 
			
		||||
  return buffer.toString(this.encoding);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function utf16DetectIncompleteChar(buffer) {
 | 
			
		||||
  var incomplete = this.charReceived = buffer.length % 2;
 | 
			
		||||
  this.charLength = incomplete ? 2 : 0;
 | 
			
		||||
  return incomplete;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function base64DetectIncompleteChar(buffer) {
 | 
			
		||||
  var incomplete = this.charReceived = buffer.length % 3;
 | 
			
		||||
  this.charLength = incomplete ? 3 : 0;
 | 
			
		||||
  return incomplete;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/sys.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/sys.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('util');
 | 
			
		||||
							
								
								
									
										39
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/timers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/timers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
try {
 | 
			
		||||
    // Old IE browsers that do not curry arguments
 | 
			
		||||
    if (!setTimeout.call) {
 | 
			
		||||
        var slicer = Array.prototype.slice;
 | 
			
		||||
        exports.setTimeout = function(fn) {
 | 
			
		||||
            var args = slicer.call(arguments, 1);
 | 
			
		||||
            return setTimeout(function() {
 | 
			
		||||
                return fn.apply(this, args);
 | 
			
		||||
            })
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        exports.setInterval = function(fn) {
 | 
			
		||||
            var args = slicer.call(arguments, 1);
 | 
			
		||||
            return setInterval(function() {
 | 
			
		||||
                return fn.apply(this, args);
 | 
			
		||||
            });
 | 
			
		||||
        };
 | 
			
		||||
    } else {
 | 
			
		||||
        exports.setTimeout = setTimeout;
 | 
			
		||||
        exports.setInterval = setInterval;
 | 
			
		||||
    }
 | 
			
		||||
    exports.clearTimeout = clearTimeout;
 | 
			
		||||
    exports.clearInterval = clearInterval;
 | 
			
		||||
 | 
			
		||||
    // Chrome and PhantomJS seems to depend on `this` pseudo variable being a
 | 
			
		||||
    // `window` and throws invalid invocation exception otherwise. If this code
 | 
			
		||||
    // runs in such JS runtime next line will throw and `catch` clause will
 | 
			
		||||
    // exported timers functions bound to a window.
 | 
			
		||||
    exports.setTimeout(function() {});
 | 
			
		||||
} catch (_) {
 | 
			
		||||
    function bind(f, context) {
 | 
			
		||||
        return function () { return f.apply(context, arguments) };
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    exports.setTimeout = bind(setTimeout, window);
 | 
			
		||||
    exports.setInterval = bind(setInterval, window);
 | 
			
		||||
    exports.clearTimeout = bind(clearTimeout, window);
 | 
			
		||||
    exports.clearInterval = bind(clearInterval, window);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/tls.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/tls.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
// todo
 | 
			
		||||
							
								
								
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/tty.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/tty.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
exports.isatty = function () {};
 | 
			
		||||
exports.setRawMode = function () {};
 | 
			
		||||
							
								
								
									
										604
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/url.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										604
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/url.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,604 @@
 | 
			
		||||
var punycode = { encode : function (s) { return s } };
 | 
			
		||||
 | 
			
		||||
exports.parse = urlParse;
 | 
			
		||||
exports.resolve = urlResolve;
 | 
			
		||||
exports.resolveObject = urlResolveObject;
 | 
			
		||||
exports.format = urlFormat;
 | 
			
		||||
 | 
			
		||||
function arrayIndexOf(array, subject) {
 | 
			
		||||
    for (var i = 0, j = array.length; i < j; i++) {
 | 
			
		||||
        if(array[i] == subject) return i;
 | 
			
		||||
    }
 | 
			
		||||
    return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var objectKeys = Object.keys || function objectKeys(object) {
 | 
			
		||||
    if (object !== Object(object)) throw new TypeError('Invalid object');
 | 
			
		||||
    var keys = [];
 | 
			
		||||
    for (var key in object) if (object.hasOwnProperty(key)) keys[keys.length] = key;
 | 
			
		||||
    return keys;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Reference: RFC 3986, RFC 1808, RFC 2396
 | 
			
		||||
 | 
			
		||||
// define these here so at least they only have to be
 | 
			
		||||
// compiled once on the first module load.
 | 
			
		||||
var protocolPattern = /^([a-z0-9.+-]+:)/i,
 | 
			
		||||
    portPattern = /:[0-9]+$/,
 | 
			
		||||
    // RFC 2396: characters reserved for delimiting URLs.
 | 
			
		||||
    delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
 | 
			
		||||
    // RFC 2396: characters not allowed for various reasons.
 | 
			
		||||
    unwise = ['{', '}', '|', '\\', '^', '~', '[', ']', '`'].concat(delims),
 | 
			
		||||
    // Allowed by RFCs, but cause of XSS attacks.  Always escape these.
 | 
			
		||||
    autoEscape = ['\''],
 | 
			
		||||
    // Characters that are never ever allowed in a hostname.
 | 
			
		||||
    // Note that any invalid chars are also handled, but these
 | 
			
		||||
    // are the ones that are *expected* to be seen, so we fast-path
 | 
			
		||||
    // them.
 | 
			
		||||
    nonHostChars = ['%', '/', '?', ';', '#']
 | 
			
		||||
      .concat(unwise).concat(autoEscape),
 | 
			
		||||
    nonAuthChars = ['/', '@', '?', '#'].concat(delims),
 | 
			
		||||
    hostnameMaxLen = 255,
 | 
			
		||||
    hostnamePartPattern = /^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/,
 | 
			
		||||
    hostnamePartStart = /^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/,
 | 
			
		||||
    // protocols that can allow "unsafe" and "unwise" chars.
 | 
			
		||||
    unsafeProtocol = {
 | 
			
		||||
      'javascript': true,
 | 
			
		||||
      'javascript:': true
 | 
			
		||||
    },
 | 
			
		||||
    // protocols that never have a hostname.
 | 
			
		||||
    hostlessProtocol = {
 | 
			
		||||
      'javascript': true,
 | 
			
		||||
      'javascript:': true
 | 
			
		||||
    },
 | 
			
		||||
    // protocols that always have a path component.
 | 
			
		||||
    pathedProtocol = {
 | 
			
		||||
      'http': true,
 | 
			
		||||
      'https': true,
 | 
			
		||||
      'ftp': true,
 | 
			
		||||
      'gopher': true,
 | 
			
		||||
      'file': true,
 | 
			
		||||
      'http:': true,
 | 
			
		||||
      'ftp:': true,
 | 
			
		||||
      'gopher:': true,
 | 
			
		||||
      'file:': true
 | 
			
		||||
    },
 | 
			
		||||
    // protocols that always contain a // bit.
 | 
			
		||||
    slashedProtocol = {
 | 
			
		||||
      'http': true,
 | 
			
		||||
      'https': true,
 | 
			
		||||
      'ftp': true,
 | 
			
		||||
      'gopher': true,
 | 
			
		||||
      'file': true,
 | 
			
		||||
      'http:': true,
 | 
			
		||||
      'https:': true,
 | 
			
		||||
      'ftp:': true,
 | 
			
		||||
      'gopher:': true,
 | 
			
		||||
      'file:': true
 | 
			
		||||
    },
 | 
			
		||||
    querystring = require('querystring');
 | 
			
		||||
 | 
			
		||||
function urlParse(url, parseQueryString, slashesDenoteHost) {
 | 
			
		||||
  if (url && typeof(url) === 'object' && url.href) return url;
 | 
			
		||||
 | 
			
		||||
  if (typeof url !== 'string') {
 | 
			
		||||
    throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var out = {},
 | 
			
		||||
      rest = url;
 | 
			
		||||
 | 
			
		||||
  // cut off any delimiters.
 | 
			
		||||
  // This is to support parse stuff like "<http://foo.com>"
 | 
			
		||||
  for (var i = 0, l = rest.length; i < l; i++) {
 | 
			
		||||
    if (arrayIndexOf(delims, rest.charAt(i)) === -1) break;
 | 
			
		||||
  }
 | 
			
		||||
  if (i !== 0) rest = rest.substr(i);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  var proto = protocolPattern.exec(rest);
 | 
			
		||||
  if (proto) {
 | 
			
		||||
    proto = proto[0];
 | 
			
		||||
    var lowerProto = proto.toLowerCase();
 | 
			
		||||
    out.protocol = lowerProto;
 | 
			
		||||
    rest = rest.substr(proto.length);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // figure out if it's got a host
 | 
			
		||||
  // user@server is *always* interpreted as a hostname, and url
 | 
			
		||||
  // resolution will treat //foo/bar as host=foo,path=bar because that's
 | 
			
		||||
  // how the browser resolves relative URLs.
 | 
			
		||||
  if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
 | 
			
		||||
    var slashes = rest.substr(0, 2) === '//';
 | 
			
		||||
    if (slashes && !(proto && hostlessProtocol[proto])) {
 | 
			
		||||
      rest = rest.substr(2);
 | 
			
		||||
      out.slashes = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!hostlessProtocol[proto] &&
 | 
			
		||||
      (slashes || (proto && !slashedProtocol[proto]))) {
 | 
			
		||||
    // there's a hostname.
 | 
			
		||||
    // the first instance of /, ?, ;, or # ends the host.
 | 
			
		||||
    // don't enforce full RFC correctness, just be unstupid about it.
 | 
			
		||||
 | 
			
		||||
    // If there is an @ in the hostname, then non-host chars *are* allowed
 | 
			
		||||
    // to the left of the first @ sign, unless some non-auth character
 | 
			
		||||
    // comes *before* the @-sign.
 | 
			
		||||
    // URLs are obnoxious.
 | 
			
		||||
    var atSign = arrayIndexOf(rest, '@');
 | 
			
		||||
    if (atSign !== -1) {
 | 
			
		||||
      // there *may be* an auth
 | 
			
		||||
      var hasAuth = true;
 | 
			
		||||
      for (var i = 0, l = nonAuthChars.length; i < l; i++) {
 | 
			
		||||
        var index = arrayIndexOf(rest, nonAuthChars[i]);
 | 
			
		||||
        if (index !== -1 && index < atSign) {
 | 
			
		||||
          // not a valid auth.  Something like http://foo.com/bar@baz/
 | 
			
		||||
          hasAuth = false;
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (hasAuth) {
 | 
			
		||||
        // pluck off the auth portion.
 | 
			
		||||
        out.auth = rest.substr(0, atSign);
 | 
			
		||||
        rest = rest.substr(atSign + 1);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var firstNonHost = -1;
 | 
			
		||||
    for (var i = 0, l = nonHostChars.length; i < l; i++) {
 | 
			
		||||
      var index = arrayIndexOf(rest, nonHostChars[i]);
 | 
			
		||||
      if (index !== -1 &&
 | 
			
		||||
          (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (firstNonHost !== -1) {
 | 
			
		||||
      out.host = rest.substr(0, firstNonHost);
 | 
			
		||||
      rest = rest.substr(firstNonHost);
 | 
			
		||||
    } else {
 | 
			
		||||
      out.host = rest;
 | 
			
		||||
      rest = '';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // pull out port.
 | 
			
		||||
    var p = parseHost(out.host);
 | 
			
		||||
    var keys = objectKeys(p);
 | 
			
		||||
    for (var i = 0, l = keys.length; i < l; i++) {
 | 
			
		||||
      var key = keys[i];
 | 
			
		||||
      out[key] = p[key];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // we've indicated that there is a hostname,
 | 
			
		||||
    // so even if it's empty, it has to be present.
 | 
			
		||||
    out.hostname = out.hostname || '';
 | 
			
		||||
 | 
			
		||||
    // validate a little.
 | 
			
		||||
    if (out.hostname.length > hostnameMaxLen) {
 | 
			
		||||
      out.hostname = '';
 | 
			
		||||
    } else {
 | 
			
		||||
      var hostparts = out.hostname.split(/\./);
 | 
			
		||||
      for (var i = 0, l = hostparts.length; i < l; i++) {
 | 
			
		||||
        var part = hostparts[i];
 | 
			
		||||
        if (!part) continue;
 | 
			
		||||
        if (!part.match(hostnamePartPattern)) {
 | 
			
		||||
          var newpart = '';
 | 
			
		||||
          for (var j = 0, k = part.length; j < k; j++) {
 | 
			
		||||
            if (part.charCodeAt(j) > 127) {
 | 
			
		||||
              // we replace non-ASCII char with a temporary placeholder
 | 
			
		||||
              // we need this to make sure size of hostname is not
 | 
			
		||||
              // broken by replacing non-ASCII by nothing
 | 
			
		||||
              newpart += 'x';
 | 
			
		||||
            } else {
 | 
			
		||||
              newpart += part[j];
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          // we test again with ASCII char only
 | 
			
		||||
          if (!newpart.match(hostnamePartPattern)) {
 | 
			
		||||
            var validParts = hostparts.slice(0, i);
 | 
			
		||||
            var notHost = hostparts.slice(i + 1);
 | 
			
		||||
            var bit = part.match(hostnamePartStart);
 | 
			
		||||
            if (bit) {
 | 
			
		||||
              validParts.push(bit[1]);
 | 
			
		||||
              notHost.unshift(bit[2]);
 | 
			
		||||
            }
 | 
			
		||||
            if (notHost.length) {
 | 
			
		||||
              rest = '/' + notHost.join('.') + rest;
 | 
			
		||||
            }
 | 
			
		||||
            out.hostname = validParts.join('.');
 | 
			
		||||
            break;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // hostnames are always lower case.
 | 
			
		||||
    out.hostname = out.hostname.toLowerCase();
 | 
			
		||||
 | 
			
		||||
    // IDNA Support: Returns a puny coded representation of "domain".
 | 
			
		||||
    // It only converts the part of the domain name that
 | 
			
		||||
    // has non ASCII characters. I.e. it dosent matter if
 | 
			
		||||
    // you call it with a domain that already is in ASCII.
 | 
			
		||||
    var domainArray = out.hostname.split('.');
 | 
			
		||||
    var newOut = [];
 | 
			
		||||
    for (var i = 0; i < domainArray.length; ++i) {
 | 
			
		||||
      var s = domainArray[i];
 | 
			
		||||
      newOut.push(s.match(/[^A-Za-z0-9_-]/) ?
 | 
			
		||||
          'xn--' + punycode.encode(s) : s);
 | 
			
		||||
    }
 | 
			
		||||
    out.hostname = newOut.join('.');
 | 
			
		||||
 | 
			
		||||
    out.host = (out.hostname || '') +
 | 
			
		||||
        ((out.port) ? ':' + out.port : '');
 | 
			
		||||
    out.href += out.host;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // now rest is set to the post-host stuff.
 | 
			
		||||
  // chop off any delim chars.
 | 
			
		||||
  if (!unsafeProtocol[lowerProto]) {
 | 
			
		||||
 | 
			
		||||
    // First, make 100% sure that any "autoEscape" chars get
 | 
			
		||||
    // escaped, even if encodeURIComponent doesn't think they
 | 
			
		||||
    // need to be.
 | 
			
		||||
    for (var i = 0, l = autoEscape.length; i < l; i++) {
 | 
			
		||||
      var ae = autoEscape[i];
 | 
			
		||||
      var esc = encodeURIComponent(ae);
 | 
			
		||||
      if (esc === ae) {
 | 
			
		||||
        esc = escape(ae);
 | 
			
		||||
      }
 | 
			
		||||
      rest = rest.split(ae).join(esc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Now make sure that delims never appear in a url.
 | 
			
		||||
    var chop = rest.length;
 | 
			
		||||
    for (var i = 0, l = delims.length; i < l; i++) {
 | 
			
		||||
      var c = arrayIndexOf(rest, delims[i]);
 | 
			
		||||
      if (c !== -1) {
 | 
			
		||||
        chop = Math.min(c, chop);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    rest = rest.substr(0, chop);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  // chop off from the tail first.
 | 
			
		||||
  var hash = arrayIndexOf(rest, '#');
 | 
			
		||||
  if (hash !== -1) {
 | 
			
		||||
    // got a fragment string.
 | 
			
		||||
    out.hash = rest.substr(hash);
 | 
			
		||||
    rest = rest.slice(0, hash);
 | 
			
		||||
  }
 | 
			
		||||
  var qm = arrayIndexOf(rest, '?');
 | 
			
		||||
  if (qm !== -1) {
 | 
			
		||||
    out.search = rest.substr(qm);
 | 
			
		||||
    out.query = rest.substr(qm + 1);
 | 
			
		||||
    if (parseQueryString) {
 | 
			
		||||
      out.query = querystring.parse(out.query);
 | 
			
		||||
    }
 | 
			
		||||
    rest = rest.slice(0, qm);
 | 
			
		||||
  } else if (parseQueryString) {
 | 
			
		||||
    // no query string, but parseQueryString still requested
 | 
			
		||||
    out.search = '';
 | 
			
		||||
    out.query = {};
 | 
			
		||||
  }
 | 
			
		||||
  if (rest) out.pathname = rest;
 | 
			
		||||
  if (slashedProtocol[proto] &&
 | 
			
		||||
      out.hostname && !out.pathname) {
 | 
			
		||||
    out.pathname = '/';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //to support http.request
 | 
			
		||||
  if (out.pathname || out.search) {
 | 
			
		||||
    out.path = (out.pathname ? out.pathname : '') +
 | 
			
		||||
               (out.search ? out.search : '');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // finally, reconstruct the href based on what has been validated.
 | 
			
		||||
  out.href = urlFormat(out);
 | 
			
		||||
  return out;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// format a parsed object into a url string
 | 
			
		||||
function urlFormat(obj) {
 | 
			
		||||
  // ensure it's an object, and not a string url.
 | 
			
		||||
  // If it's an obj, this is a no-op.
 | 
			
		||||
  // this way, you can call url_format() on strings
 | 
			
		||||
  // to clean up potentially wonky urls.
 | 
			
		||||
  if (typeof(obj) === 'string') obj = urlParse(obj);
 | 
			
		||||
 | 
			
		||||
  var auth = obj.auth || '';
 | 
			
		||||
  if (auth) {
 | 
			
		||||
    auth = auth.split('@').join('%40');
 | 
			
		||||
    for (var i = 0, l = nonAuthChars.length; i < l; i++) {
 | 
			
		||||
      var nAC = nonAuthChars[i];
 | 
			
		||||
      auth = auth.split(nAC).join(encodeURIComponent(nAC));
 | 
			
		||||
    }
 | 
			
		||||
    auth += '@';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var protocol = obj.protocol || '',
 | 
			
		||||
      host = (obj.host !== undefined) ? auth + obj.host :
 | 
			
		||||
          obj.hostname !== undefined ? (
 | 
			
		||||
              auth + obj.hostname +
 | 
			
		||||
              (obj.port ? ':' + obj.port : '')
 | 
			
		||||
          ) :
 | 
			
		||||
          false,
 | 
			
		||||
      pathname = obj.pathname || '',
 | 
			
		||||
      query = obj.query &&
 | 
			
		||||
              ((typeof obj.query === 'object' &&
 | 
			
		||||
                objectKeys(obj.query).length) ?
 | 
			
		||||
                 querystring.stringify(obj.query) :
 | 
			
		||||
                 '') || '',
 | 
			
		||||
      search = obj.search || (query && ('?' + query)) || '',
 | 
			
		||||
      hash = obj.hash || '';
 | 
			
		||||
 | 
			
		||||
  if (protocol && protocol.substr(-1) !== ':') protocol += ':';
 | 
			
		||||
 | 
			
		||||
  // only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.
 | 
			
		||||
  // unless they had them to begin with.
 | 
			
		||||
  if (obj.slashes ||
 | 
			
		||||
      (!protocol || slashedProtocol[protocol]) && host !== false) {
 | 
			
		||||
    host = '//' + (host || '');
 | 
			
		||||
    if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
 | 
			
		||||
  } else if (!host) {
 | 
			
		||||
    host = '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
 | 
			
		||||
  if (search && search.charAt(0) !== '?') search = '?' + search;
 | 
			
		||||
 | 
			
		||||
  return protocol + host + pathname + search + hash;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function urlResolve(source, relative) {
 | 
			
		||||
  return urlFormat(urlResolveObject(source, relative));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function urlResolveObject(source, relative) {
 | 
			
		||||
  if (!source) return relative;
 | 
			
		||||
 | 
			
		||||
  source = urlParse(urlFormat(source), false, true);
 | 
			
		||||
  relative = urlParse(urlFormat(relative), false, true);
 | 
			
		||||
 | 
			
		||||
  // hash is always overridden, no matter what.
 | 
			
		||||
  source.hash = relative.hash;
 | 
			
		||||
 | 
			
		||||
  if (relative.href === '') {
 | 
			
		||||
    source.href = urlFormat(source);
 | 
			
		||||
    return source;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // hrefs like //foo/bar always cut to the protocol.
 | 
			
		||||
  if (relative.slashes && !relative.protocol) {
 | 
			
		||||
    relative.protocol = source.protocol;
 | 
			
		||||
    //urlParse appends trailing / to urls like http://www.example.com
 | 
			
		||||
    if (slashedProtocol[relative.protocol] &&
 | 
			
		||||
        relative.hostname && !relative.pathname) {
 | 
			
		||||
      relative.path = relative.pathname = '/';
 | 
			
		||||
    }
 | 
			
		||||
    relative.href = urlFormat(relative);
 | 
			
		||||
    return relative;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (relative.protocol && relative.protocol !== source.protocol) {
 | 
			
		||||
    // if it's a known url protocol, then changing
 | 
			
		||||
    // the protocol does weird things
 | 
			
		||||
    // first, if it's not file:, then we MUST have a host,
 | 
			
		||||
    // and if there was a path
 | 
			
		||||
    // to begin with, then we MUST have a path.
 | 
			
		||||
    // if it is file:, then the host is dropped,
 | 
			
		||||
    // because that's known to be hostless.
 | 
			
		||||
    // anything else is assumed to be absolute.
 | 
			
		||||
    if (!slashedProtocol[relative.protocol]) {
 | 
			
		||||
      relative.href = urlFormat(relative);
 | 
			
		||||
      return relative;
 | 
			
		||||
    }
 | 
			
		||||
    source.protocol = relative.protocol;
 | 
			
		||||
    if (!relative.host && !hostlessProtocol[relative.protocol]) {
 | 
			
		||||
      var relPath = (relative.pathname || '').split('/');
 | 
			
		||||
      while (relPath.length && !(relative.host = relPath.shift()));
 | 
			
		||||
      if (!relative.host) relative.host = '';
 | 
			
		||||
      if (!relative.hostname) relative.hostname = '';
 | 
			
		||||
      if (relPath[0] !== '') relPath.unshift('');
 | 
			
		||||
      if (relPath.length < 2) relPath.unshift('');
 | 
			
		||||
      relative.pathname = relPath.join('/');
 | 
			
		||||
    }
 | 
			
		||||
    source.pathname = relative.pathname;
 | 
			
		||||
    source.search = relative.search;
 | 
			
		||||
    source.query = relative.query;
 | 
			
		||||
    source.host = relative.host || '';
 | 
			
		||||
    source.auth = relative.auth;
 | 
			
		||||
    source.hostname = relative.hostname || relative.host;
 | 
			
		||||
    source.port = relative.port;
 | 
			
		||||
    //to support http.request
 | 
			
		||||
    if (source.pathname !== undefined || source.search !== undefined) {
 | 
			
		||||
      source.path = (source.pathname ? source.pathname : '') +
 | 
			
		||||
                    (source.search ? source.search : '');
 | 
			
		||||
    }
 | 
			
		||||
    source.slashes = source.slashes || relative.slashes;
 | 
			
		||||
    source.href = urlFormat(source);
 | 
			
		||||
    return source;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var isSourceAbs = (source.pathname && source.pathname.charAt(0) === '/'),
 | 
			
		||||
      isRelAbs = (
 | 
			
		||||
          relative.host !== undefined ||
 | 
			
		||||
          relative.pathname && relative.pathname.charAt(0) === '/'
 | 
			
		||||
      ),
 | 
			
		||||
      mustEndAbs = (isRelAbs || isSourceAbs ||
 | 
			
		||||
                    (source.host && relative.pathname)),
 | 
			
		||||
      removeAllDots = mustEndAbs,
 | 
			
		||||
      srcPath = source.pathname && source.pathname.split('/') || [],
 | 
			
		||||
      relPath = relative.pathname && relative.pathname.split('/') || [],
 | 
			
		||||
      psychotic = source.protocol &&
 | 
			
		||||
          !slashedProtocol[source.protocol];
 | 
			
		||||
 | 
			
		||||
  // if the url is a non-slashed url, then relative
 | 
			
		||||
  // links like ../.. should be able
 | 
			
		||||
  // to crawl up to the hostname, as well.  This is strange.
 | 
			
		||||
  // source.protocol has already been set by now.
 | 
			
		||||
  // Later on, put the first path part into the host field.
 | 
			
		||||
  if (psychotic) {
 | 
			
		||||
 | 
			
		||||
    delete source.hostname;
 | 
			
		||||
    delete source.port;
 | 
			
		||||
    if (source.host) {
 | 
			
		||||
      if (srcPath[0] === '') srcPath[0] = source.host;
 | 
			
		||||
      else srcPath.unshift(source.host);
 | 
			
		||||
    }
 | 
			
		||||
    delete source.host;
 | 
			
		||||
    if (relative.protocol) {
 | 
			
		||||
      delete relative.hostname;
 | 
			
		||||
      delete relative.port;
 | 
			
		||||
      if (relative.host) {
 | 
			
		||||
        if (relPath[0] === '') relPath[0] = relative.host;
 | 
			
		||||
        else relPath.unshift(relative.host);
 | 
			
		||||
      }
 | 
			
		||||
      delete relative.host;
 | 
			
		||||
    }
 | 
			
		||||
    mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (isRelAbs) {
 | 
			
		||||
    // it's absolute.
 | 
			
		||||
    source.host = (relative.host || relative.host === '') ?
 | 
			
		||||
                      relative.host : source.host;
 | 
			
		||||
    source.hostname = (relative.hostname || relative.hostname === '') ?
 | 
			
		||||
                      relative.hostname : source.hostname;
 | 
			
		||||
    source.search = relative.search;
 | 
			
		||||
    source.query = relative.query;
 | 
			
		||||
    srcPath = relPath;
 | 
			
		||||
    // fall through to the dot-handling below.
 | 
			
		||||
  } else if (relPath.length) {
 | 
			
		||||
    // it's relative
 | 
			
		||||
    // throw away the existing file, and take the new path instead.
 | 
			
		||||
    if (!srcPath) srcPath = [];
 | 
			
		||||
    srcPath.pop();
 | 
			
		||||
    srcPath = srcPath.concat(relPath);
 | 
			
		||||
    source.search = relative.search;
 | 
			
		||||
    source.query = relative.query;
 | 
			
		||||
  } else if ('search' in relative) {
 | 
			
		||||
    // just pull out the search.
 | 
			
		||||
    // like href='?foo'.
 | 
			
		||||
    // Put this after the other two cases because it simplifies the booleans
 | 
			
		||||
    if (psychotic) {
 | 
			
		||||
      source.hostname = source.host = srcPath.shift();
 | 
			
		||||
      //occationaly the auth can get stuck only in host
 | 
			
		||||
      //this especialy happens in cases like
 | 
			
		||||
      //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
 | 
			
		||||
      var authInHost = source.host && arrayIndexOf(source.host, '@') > 0 ?
 | 
			
		||||
                       source.host.split('@') : false;
 | 
			
		||||
      if (authInHost) {
 | 
			
		||||
        source.auth = authInHost.shift();
 | 
			
		||||
        source.host = source.hostname = authInHost.shift();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    source.search = relative.search;
 | 
			
		||||
    source.query = relative.query;
 | 
			
		||||
    //to support http.request
 | 
			
		||||
    if (source.pathname !== undefined || source.search !== undefined) {
 | 
			
		||||
      source.path = (source.pathname ? source.pathname : '') +
 | 
			
		||||
                    (source.search ? source.search : '');
 | 
			
		||||
    }
 | 
			
		||||
    source.href = urlFormat(source);
 | 
			
		||||
    return source;
 | 
			
		||||
  }
 | 
			
		||||
  if (!srcPath.length) {
 | 
			
		||||
    // no path at all.  easy.
 | 
			
		||||
    // we've already handled the other stuff above.
 | 
			
		||||
    delete source.pathname;
 | 
			
		||||
    //to support http.request
 | 
			
		||||
    if (!source.search) {
 | 
			
		||||
      source.path = '/' + source.search;
 | 
			
		||||
    } else {
 | 
			
		||||
      delete source.path;
 | 
			
		||||
    }
 | 
			
		||||
    source.href = urlFormat(source);
 | 
			
		||||
    return source;
 | 
			
		||||
  }
 | 
			
		||||
  // if a url ENDs in . or .., then it must get a trailing slash.
 | 
			
		||||
  // however, if it ends in anything else non-slashy,
 | 
			
		||||
  // then it must NOT get a trailing slash.
 | 
			
		||||
  var last = srcPath.slice(-1)[0];
 | 
			
		||||
  var hasTrailingSlash = (
 | 
			
		||||
      (source.host || relative.host) && (last === '.' || last === '..') ||
 | 
			
		||||
      last === '');
 | 
			
		||||
 | 
			
		||||
  // strip single dots, resolve double dots to parent dir
 | 
			
		||||
  // if the path tries to go above the root, `up` ends up > 0
 | 
			
		||||
  var up = 0;
 | 
			
		||||
  for (var i = srcPath.length; i >= 0; i--) {
 | 
			
		||||
    last = srcPath[i];
 | 
			
		||||
    if (last == '.') {
 | 
			
		||||
      srcPath.splice(i, 1);
 | 
			
		||||
    } else if (last === '..') {
 | 
			
		||||
      srcPath.splice(i, 1);
 | 
			
		||||
      up++;
 | 
			
		||||
    } else if (up) {
 | 
			
		||||
      srcPath.splice(i, 1);
 | 
			
		||||
      up--;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // if the path is allowed to go above the root, restore leading ..s
 | 
			
		||||
  if (!mustEndAbs && !removeAllDots) {
 | 
			
		||||
    for (; up--; up) {
 | 
			
		||||
      srcPath.unshift('..');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (mustEndAbs && srcPath[0] !== '' &&
 | 
			
		||||
      (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
 | 
			
		||||
    srcPath.unshift('');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
 | 
			
		||||
    srcPath.push('');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var isAbsolute = srcPath[0] === '' ||
 | 
			
		||||
      (srcPath[0] && srcPath[0].charAt(0) === '/');
 | 
			
		||||
 | 
			
		||||
  // put the host back
 | 
			
		||||
  if (psychotic) {
 | 
			
		||||
    source.hostname = source.host = isAbsolute ? '' :
 | 
			
		||||
                                    srcPath.length ? srcPath.shift() : '';
 | 
			
		||||
    //occationaly the auth can get stuck only in host
 | 
			
		||||
    //this especialy happens in cases like
 | 
			
		||||
    //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
 | 
			
		||||
    var authInHost = source.host && arrayIndexOf(source.host, '@') > 0 ?
 | 
			
		||||
                     source.host.split('@') : false;
 | 
			
		||||
    if (authInHost) {
 | 
			
		||||
      source.auth = authInHost.shift();
 | 
			
		||||
      source.host = source.hostname = authInHost.shift();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  mustEndAbs = mustEndAbs || (source.host && srcPath.length);
 | 
			
		||||
 | 
			
		||||
  if (mustEndAbs && !isAbsolute) {
 | 
			
		||||
    srcPath.unshift('');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source.pathname = srcPath.join('/');
 | 
			
		||||
  //to support request.http
 | 
			
		||||
  if (source.pathname !== undefined || source.search !== undefined) {
 | 
			
		||||
    source.path = (source.pathname ? source.pathname : '') +
 | 
			
		||||
                  (source.search ? source.search : '');
 | 
			
		||||
  }
 | 
			
		||||
  source.auth = relative.auth || source.auth;
 | 
			
		||||
  source.slashes = source.slashes || relative.slashes;
 | 
			
		||||
  source.href = urlFormat(source);
 | 
			
		||||
  return source;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function parseHost(host) {
 | 
			
		||||
  var out = {};
 | 
			
		||||
  var port = portPattern.exec(host);
 | 
			
		||||
  if (port) {
 | 
			
		||||
    port = port[0];
 | 
			
		||||
    out.port = port.substr(1);
 | 
			
		||||
    host = host.substr(0, host.length - port.length);
 | 
			
		||||
  }
 | 
			
		||||
  if (host) out.hostname = host;
 | 
			
		||||
  return out;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										351
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/util.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										351
									
								
								node_modules/filesystem-browserify/node_modules/browserify/builtins/util.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,351 @@
 | 
			
		||||
var events = require('events');
 | 
			
		||||
 | 
			
		||||
exports.isArray = isArray;
 | 
			
		||||
exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'};
 | 
			
		||||
exports.isRegExp = function(obj){return Object.prototype.toString.call(obj) === '[object RegExp]'};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.print = function () {};
 | 
			
		||||
exports.puts = function () {};
 | 
			
		||||
exports.debug = function() {};
 | 
			
		||||
 | 
			
		||||
exports.inspect = function(obj, showHidden, depth, colors) {
 | 
			
		||||
  var seen = [];
 | 
			
		||||
 | 
			
		||||
  var stylize = function(str, styleType) {
 | 
			
		||||
    // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
 | 
			
		||||
    var styles =
 | 
			
		||||
        { 'bold' : [1, 22],
 | 
			
		||||
          'italic' : [3, 23],
 | 
			
		||||
          'underline' : [4, 24],
 | 
			
		||||
          'inverse' : [7, 27],
 | 
			
		||||
          'white' : [37, 39],
 | 
			
		||||
          'grey' : [90, 39],
 | 
			
		||||
          'black' : [30, 39],
 | 
			
		||||
          'blue' : [34, 39],
 | 
			
		||||
          'cyan' : [36, 39],
 | 
			
		||||
          'green' : [32, 39],
 | 
			
		||||
          'magenta' : [35, 39],
 | 
			
		||||
          'red' : [31, 39],
 | 
			
		||||
          'yellow' : [33, 39] };
 | 
			
		||||
 | 
			
		||||
    var style =
 | 
			
		||||
        { 'special': 'cyan',
 | 
			
		||||
          'number': 'blue',
 | 
			
		||||
          'boolean': 'yellow',
 | 
			
		||||
          'undefined': 'grey',
 | 
			
		||||
          'null': 'bold',
 | 
			
		||||
          'string': 'green',
 | 
			
		||||
          'date': 'magenta',
 | 
			
		||||
          // "name": intentionally not styling
 | 
			
		||||
          'regexp': 'red' }[styleType];
 | 
			
		||||
 | 
			
		||||
    if (style) {
 | 
			
		||||
      return '\033[' + styles[style][0] + 'm' + str +
 | 
			
		||||
             '\033[' + styles[style][1] + 'm';
 | 
			
		||||
    } else {
 | 
			
		||||
      return str;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
  if (! colors) {
 | 
			
		||||
    stylize = function(str, styleType) { return str; };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function format(value, recurseTimes) {
 | 
			
		||||
    // Provide a hook for user-specified inspect functions.
 | 
			
		||||
    // Check that value is an object with an inspect function on it
 | 
			
		||||
    if (value && typeof value.inspect === 'function' &&
 | 
			
		||||
        // Filter out the util module, it's inspect function is special
 | 
			
		||||
        value !== exports &&
 | 
			
		||||
        // Also filter out any prototype objects using the circular check.
 | 
			
		||||
        !(value.constructor && value.constructor.prototype === value)) {
 | 
			
		||||
      return value.inspect(recurseTimes);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Primitive types cannot have properties
 | 
			
		||||
    switch (typeof value) {
 | 
			
		||||
      case 'undefined':
 | 
			
		||||
        return stylize('undefined', 'undefined');
 | 
			
		||||
 | 
			
		||||
      case 'string':
 | 
			
		||||
        var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
 | 
			
		||||
                                                 .replace(/'/g, "\\'")
 | 
			
		||||
                                                 .replace(/\\"/g, '"') + '\'';
 | 
			
		||||
        return stylize(simple, 'string');
 | 
			
		||||
 | 
			
		||||
      case 'number':
 | 
			
		||||
        return stylize('' + value, 'number');
 | 
			
		||||
 | 
			
		||||
      case 'boolean':
 | 
			
		||||
        return stylize('' + value, 'boolean');
 | 
			
		||||
    }
 | 
			
		||||
    // For some reason typeof null is "object", so special case here.
 | 
			
		||||
    if (value === null) {
 | 
			
		||||
      return stylize('null', 'null');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Look up the keys of the object.
 | 
			
		||||
    var visible_keys = Object_keys(value);
 | 
			
		||||
    var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys;
 | 
			
		||||
 | 
			
		||||
    // Functions without properties can be shortcutted.
 | 
			
		||||
    if (typeof value === 'function' && keys.length === 0) {
 | 
			
		||||
      if (isRegExp(value)) {
 | 
			
		||||
        return stylize('' + value, 'regexp');
 | 
			
		||||
      } else {
 | 
			
		||||
        var name = value.name ? ': ' + value.name : '';
 | 
			
		||||
        return stylize('[Function' + name + ']', 'special');
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Dates without properties can be shortcutted
 | 
			
		||||
    if (isDate(value) && keys.length === 0) {
 | 
			
		||||
      return stylize(value.toUTCString(), 'date');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var base, type, braces;
 | 
			
		||||
    // Determine the object type
 | 
			
		||||
    if (isArray(value)) {
 | 
			
		||||
      type = 'Array';
 | 
			
		||||
      braces = ['[', ']'];
 | 
			
		||||
    } else {
 | 
			
		||||
      type = 'Object';
 | 
			
		||||
      braces = ['{', '}'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Make functions say that they are functions
 | 
			
		||||
    if (typeof value === 'function') {
 | 
			
		||||
      var n = value.name ? ': ' + value.name : '';
 | 
			
		||||
      base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']';
 | 
			
		||||
    } else {
 | 
			
		||||
      base = '';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Make dates with properties first say the date
 | 
			
		||||
    if (isDate(value)) {
 | 
			
		||||
      base = ' ' + value.toUTCString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (keys.length === 0) {
 | 
			
		||||
      return braces[0] + base + braces[1];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (recurseTimes < 0) {
 | 
			
		||||
      if (isRegExp(value)) {
 | 
			
		||||
        return stylize('' + value, 'regexp');
 | 
			
		||||
      } else {
 | 
			
		||||
        return stylize('[Object]', 'special');
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    seen.push(value);
 | 
			
		||||
 | 
			
		||||
    var output = keys.map(function(key) {
 | 
			
		||||
      var name, str;
 | 
			
		||||
      if (value.__lookupGetter__) {
 | 
			
		||||
        if (value.__lookupGetter__(key)) {
 | 
			
		||||
          if (value.__lookupSetter__(key)) {
 | 
			
		||||
            str = stylize('[Getter/Setter]', 'special');
 | 
			
		||||
          } else {
 | 
			
		||||
            str = stylize('[Getter]', 'special');
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          if (value.__lookupSetter__(key)) {
 | 
			
		||||
            str = stylize('[Setter]', 'special');
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (visible_keys.indexOf(key) < 0) {
 | 
			
		||||
        name = '[' + key + ']';
 | 
			
		||||
      }
 | 
			
		||||
      if (!str) {
 | 
			
		||||
        if (seen.indexOf(value[key]) < 0) {
 | 
			
		||||
          if (recurseTimes === null) {
 | 
			
		||||
            str = format(value[key]);
 | 
			
		||||
          } else {
 | 
			
		||||
            str = format(value[key], recurseTimes - 1);
 | 
			
		||||
          }
 | 
			
		||||
          if (str.indexOf('\n') > -1) {
 | 
			
		||||
            if (isArray(value)) {
 | 
			
		||||
              str = str.split('\n').map(function(line) {
 | 
			
		||||
                return '  ' + line;
 | 
			
		||||
              }).join('\n').substr(2);
 | 
			
		||||
            } else {
 | 
			
		||||
              str = '\n' + str.split('\n').map(function(line) {
 | 
			
		||||
                return '   ' + line;
 | 
			
		||||
              }).join('\n');
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          str = stylize('[Circular]', 'special');
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (typeof name === 'undefined') {
 | 
			
		||||
        if (type === 'Array' && key.match(/^\d+$/)) {
 | 
			
		||||
          return str;
 | 
			
		||||
        }
 | 
			
		||||
        name = JSON.stringify('' + key);
 | 
			
		||||
        if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
 | 
			
		||||
          name = name.substr(1, name.length - 2);
 | 
			
		||||
          name = stylize(name, 'name');
 | 
			
		||||
        } else {
 | 
			
		||||
          name = name.replace(/'/g, "\\'")
 | 
			
		||||
                     .replace(/\\"/g, '"')
 | 
			
		||||
                     .replace(/(^"|"$)/g, "'");
 | 
			
		||||
          name = stylize(name, 'string');
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return name + ': ' + str;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    seen.pop();
 | 
			
		||||
 | 
			
		||||
    var numLinesEst = 0;
 | 
			
		||||
    var length = output.reduce(function(prev, cur) {
 | 
			
		||||
      numLinesEst++;
 | 
			
		||||
      if (cur.indexOf('\n') >= 0) numLinesEst++;
 | 
			
		||||
      return prev + cur.length + 1;
 | 
			
		||||
    }, 0);
 | 
			
		||||
 | 
			
		||||
    if (length > 50) {
 | 
			
		||||
      output = braces[0] +
 | 
			
		||||
               (base === '' ? '' : base + '\n ') +
 | 
			
		||||
               ' ' +
 | 
			
		||||
               output.join(',\n  ') +
 | 
			
		||||
               ' ' +
 | 
			
		||||
               braces[1];
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
      output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return output;
 | 
			
		||||
  }
 | 
			
		||||
  return format(obj, (typeof depth === 'undefined' ? 2 : depth));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function isArray(ar) {
 | 
			
		||||
  return ar instanceof Array ||
 | 
			
		||||
         Array.isArray(ar) ||
 | 
			
		||||
         (ar && ar !== Object.prototype && isArray(ar.__proto__));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function isRegExp(re) {
 | 
			
		||||
  return re instanceof RegExp ||
 | 
			
		||||
    (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function isDate(d) {
 | 
			
		||||
  if (d instanceof Date) return true;
 | 
			
		||||
  if (typeof d !== 'object') return false;
 | 
			
		||||
  var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype);
 | 
			
		||||
  var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__);
 | 
			
		||||
  return JSON.stringify(proto) === JSON.stringify(properties);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function pad(n) {
 | 
			
		||||
  return n < 10 ? '0' + n.toString(10) : n.toString(10);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
 | 
			
		||||
              'Oct', 'Nov', 'Dec'];
 | 
			
		||||
 | 
			
		||||
// 26 Feb 16:19:34
 | 
			
		||||
function timestamp() {
 | 
			
		||||
  var d = new Date();
 | 
			
		||||
  var time = [pad(d.getHours()),
 | 
			
		||||
              pad(d.getMinutes()),
 | 
			
		||||
              pad(d.getSeconds())].join(':');
 | 
			
		||||
  return [d.getDate(), months[d.getMonth()], time].join(' ');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.log = function (msg) {};
 | 
			
		||||
 | 
			
		||||
exports.pump = null;
 | 
			
		||||
 | 
			
		||||
var Object_keys = Object.keys || function (obj) {
 | 
			
		||||
    var res = [];
 | 
			
		||||
    for (var key in obj) res.push(key);
 | 
			
		||||
    return res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
 | 
			
		||||
    var res = [];
 | 
			
		||||
    for (var key in obj) {
 | 
			
		||||
        if (Object.hasOwnProperty.call(obj, key)) res.push(key);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var Object_create = Object.create || function (prototype, properties) {
 | 
			
		||||
    // from es5-shim
 | 
			
		||||
    var object;
 | 
			
		||||
    if (prototype === null) {
 | 
			
		||||
        object = { '__proto__' : null };
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        if (typeof prototype !== 'object') {
 | 
			
		||||
            throw new TypeError(
 | 
			
		||||
                'typeof prototype[' + (typeof prototype) + '] != \'object\''
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        var Type = function () {};
 | 
			
		||||
        Type.prototype = prototype;
 | 
			
		||||
        object = new Type();
 | 
			
		||||
        object.__proto__ = prototype;
 | 
			
		||||
    }
 | 
			
		||||
    if (typeof properties !== 'undefined' && Object.defineProperties) {
 | 
			
		||||
        Object.defineProperties(object, properties);
 | 
			
		||||
    }
 | 
			
		||||
    return object;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.inherits = function(ctor, superCtor) {
 | 
			
		||||
  ctor.super_ = superCtor;
 | 
			
		||||
  ctor.prototype = Object_create(superCtor.prototype, {
 | 
			
		||||
    constructor: {
 | 
			
		||||
      value: ctor,
 | 
			
		||||
      enumerable: false,
 | 
			
		||||
      writable: true,
 | 
			
		||||
      configurable: true
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var formatRegExp = /%[sdj%]/g;
 | 
			
		||||
exports.format = function(f) {
 | 
			
		||||
  if (typeof f !== 'string') {
 | 
			
		||||
    var objects = [];
 | 
			
		||||
    for (var i = 0; i < arguments.length; i++) {
 | 
			
		||||
      objects.push(exports.inspect(arguments[i]));
 | 
			
		||||
    }
 | 
			
		||||
    return objects.join(' ');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var i = 1;
 | 
			
		||||
  var args = arguments;
 | 
			
		||||
  var len = args.length;
 | 
			
		||||
  var str = String(f).replace(formatRegExp, function(x) {
 | 
			
		||||
    if (x === '%%') return '%';
 | 
			
		||||
    if (i >= len) return x;
 | 
			
		||||
    switch (x) {
 | 
			
		||||
      case '%s': return String(args[i++]);
 | 
			
		||||
      case '%d': return Number(args[i++]);
 | 
			
		||||
      case '%j': return JSON.stringify(args[i++]);
 | 
			
		||||
      default:
 | 
			
		||||
        return x;
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  for(var x = args[i]; i < len; x = args[++i]){
 | 
			
		||||
    if (x === null || typeof x !== 'object') {
 | 
			
		||||
      str += ' ' + x;
 | 
			
		||||
    } else {
 | 
			
		||||
      str += ' ' + exports.inspect(x);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return str;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										182
									
								
								node_modules/filesystem-browserify/node_modules/browserify/doc/methods.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								node_modules/filesystem-browserify/node_modules/browserify/doc/methods.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
			
		||||
methods
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
This section documents the browserify api.
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
var browserify = require('browserify');
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
var b = browserify(opts={})
 | 
			
		||||
---------------------------
 | 
			
		||||
 | 
			
		||||
Return a new bundle object.
 | 
			
		||||
 | 
			
		||||
`opts` may also contain these fields:
 | 
			
		||||
 | 
			
		||||
* watch - set watches on files, see below
 | 
			
		||||
* cache - turn on caching for AST traversals, see below
 | 
			
		||||
* debug - turn on source mapping for debugging with `//@ sourceURL=...`
 | 
			
		||||
in browsers that support it
 | 
			
		||||
* exports - an array of the core items to export to the namespace. Available
 | 
			
		||||
items: 'require', 'process'
 | 
			
		||||
 | 
			
		||||
If `opts` is a string, it is interpreted as a file to call `.addEntry()` with.
 | 
			
		||||
 | 
			
		||||
### watch :: Boolean or Object
 | 
			
		||||
 | 
			
		||||
Set watches on files and automatically rebundle when a file changes.
 | 
			
		||||
 | 
			
		||||
This option defaults to false. If `opts.watch` is set to true, default watch
 | 
			
		||||
arguments are assumed or you can pass in an object to pass along as the second
 | 
			
		||||
parameter to `fs.watchFile()`.
 | 
			
		||||
 | 
			
		||||
### cache :: Boolean or String
 | 
			
		||||
 | 
			
		||||
If `cache` is a boolean, turn on caching at
 | 
			
		||||
`$HOME/.config/browserify/cache.json`.
 | 
			
		||||
 | 
			
		||||
If `cache` is a string, turn on caching at the filename specified by `cache`.
 | 
			
		||||
 | 
			
		||||
### bundle events
 | 
			
		||||
 | 
			
		||||
`b` bundles will also emit events.
 | 
			
		||||
 | 
			
		||||
#### 'syntaxError', err
 | 
			
		||||
 | 
			
		||||
This event gets emitted when there is a syntax error somewhere in the build
 | 
			
		||||
process. If you don't listen for this event, the error will be printed to
 | 
			
		||||
stderr.
 | 
			
		||||
 | 
			
		||||
#### 'bundle'
 | 
			
		||||
 | 
			
		||||
In watch mode, this event is emitted when a new bundle has been generated.
 | 
			
		||||
 | 
			
		||||
b.bundle()
 | 
			
		||||
----------
 | 
			
		||||
 | 
			
		||||
Return the bundled source as a string.
 | 
			
		||||
 | 
			
		||||
By default, `require` is not exported to the environment if there are entry
 | 
			
		||||
files in the bundle but you can override that with `opts.exports`.
 | 
			
		||||
 | 
			
		||||
`process` is only exported to the environment when `opts.exports` contains the
 | 
			
		||||
string `'process'`.
 | 
			
		||||
 | 
			
		||||
b.require(file)
 | 
			
		||||
---------------
 | 
			
		||||
 | 
			
		||||
Require a file or files for inclusion in the bundle.
 | 
			
		||||
 | 
			
		||||
If `file` is an array, require each element in it.
 | 
			
		||||
 | 
			
		||||
If `file` is a non-array object, map an alias to a package name.
 | 
			
		||||
For instance to be able to map `require('jquery')` to the jquery-browserify
 | 
			
		||||
package, you can do:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
b.require({ jquery : 'jquery-browserify' })
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
and the same thing in middleware-form:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
browserify({ require : { jquery : 'jquery-browserify' } })
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
To mix alias objects with regular requires you could do:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
browserify({ require : [ 'seq', { jquery : 'jquery-browserify' }, 'traverse' ])
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
In practice you won't need to `b.require()` very many files since all the
 | 
			
		||||
`require()`s are read from each file that you require and automatically
 | 
			
		||||
included.
 | 
			
		||||
 | 
			
		||||
b.ignore(file)
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
Omit a file or files from being included by the AST walk to hunt down
 | 
			
		||||
`require()` statements.
 | 
			
		||||
 | 
			
		||||
b.addEntry(file)
 | 
			
		||||
----------------
 | 
			
		||||
 | 
			
		||||
Append a file to the end of the bundle and execute it without having to
 | 
			
		||||
`require()` it.
 | 
			
		||||
 | 
			
		||||
Specifying an entry point will let you `require()` other modules without having
 | 
			
		||||
to load the entry point in a `<script>` tag yourself.
 | 
			
		||||
 | 
			
		||||
If entry is an Array, concatenate these files together and append to the end of
 | 
			
		||||
the bundle.
 | 
			
		||||
 | 
			
		||||
b.filter(fn)
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Transform the source using the filter function `fn(src)`. The return value of
 | 
			
		||||
`fn` should be the new source.
 | 
			
		||||
 | 
			
		||||
b.register(ext, fn)
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
Register a handler to wrap extensions.
 | 
			
		||||
 | 
			
		||||
Wrap every file matching the extension `ext` with the function `fn`.
 | 
			
		||||
 | 
			
		||||
For every `file` included into the bundle `fn` gets called for matching file
 | 
			
		||||
types as `fn.call(b, body, file)` for the bundle instance `b` and the file
 | 
			
		||||
content string `body`. `fn` should return the new wrapped contents.
 | 
			
		||||
 | 
			
		||||
If `ext` is unspecified, execute the wrapper for every file.
 | 
			
		||||
 | 
			
		||||
If `ext` is 'post', execute the wrapper on the entire bundle.
 | 
			
		||||
 | 
			
		||||
If `ext` is 'pre', call the wrapper function with the bundle object before the
 | 
			
		||||
source is generated.
 | 
			
		||||
 | 
			
		||||
If `ext` is 'path', execute the wrapper for every `file` before it is open,
 | 
			
		||||
allowing the extension to change it. `fn` gets called as `fn.call(b, file)`
 | 
			
		||||
for the bundle instance `b` and the file path `file`. `fn` should return the
 | 
			
		||||
new path to the file.
 | 
			
		||||
 | 
			
		||||
If `ext` is an object, pull the extension from `ext.extension` and the wrapper
 | 
			
		||||
function `fn` from `ext.wrapper`. This makes it easy to write plugins like
 | 
			
		||||
[fileify](https://github.com/substack/node-fileify).
 | 
			
		||||
 | 
			
		||||
Coffee script support is just implemented internally as a `.register()`
 | 
			
		||||
extension:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
b.register('.coffee', function (body) {
 | 
			
		||||
    return coffee.compile(body);
 | 
			
		||||
});
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
b.use(fn)
 | 
			
		||||
---------
 | 
			
		||||
 | 
			
		||||
Use a middleware plugin, `fn`. `fn` is called with the instance object `b`.
 | 
			
		||||
 | 
			
		||||
b.prepend(content)
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
Prepend unwrapped content to the beginning of the bundle.
 | 
			
		||||
 | 
			
		||||
b.append(content)
 | 
			
		||||
-----------------
 | 
			
		||||
 | 
			
		||||
Append unwrapped content to the end of the bundle.
 | 
			
		||||
 | 
			
		||||
b.alias(to, from)
 | 
			
		||||
-----------------
 | 
			
		||||
 | 
			
		||||
Alias a package name from another package name.
 | 
			
		||||
 | 
			
		||||
b.modified
 | 
			
		||||
----------
 | 
			
		||||
 | 
			
		||||
Contains a Date object with the time the bundle was last modified. This field is
 | 
			
		||||
useful in conjunction with the `watch` field described in the `browserify()` to
 | 
			
		||||
generate unique `<script>` `src` values to force script reloading.
 | 
			
		||||
							
								
								
									
										62
									
								
								node_modules/filesystem-browserify/node_modules/browserify/doc/recipes.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								node_modules/filesystem-browserify/node_modules/browserify/doc/recipes.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
recipes
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
Here are some recipe-style examples for getting started.
 | 
			
		||||
 | 
			
		||||
use an npm module in the browser
 | 
			
		||||
================================
 | 
			
		||||
 | 
			
		||||
First install a module:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
npm install traverse
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Then write an `entry.js`:
 | 
			
		||||
 | 
			
		||||
````javascript
 | 
			
		||||
var traverse = require('traverse');
 | 
			
		||||
var obj = traverse({ a : 3, b : [ 4, 5 ] }).map(function (x) {
 | 
			
		||||
    if (typeof x === 'number') this.update(x * 100)
 | 
			
		||||
});
 | 
			
		||||
console.dir(obj);
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
now bundle it!
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
$ browserify entry.js -o bundle.js
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
then put it in your html
 | 
			
		||||
 | 
			
		||||
``` html
 | 
			
		||||
<script src="bundle.js"></script>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
and the entry.js will just run and `require('traverse')` will just work™.
 | 
			
		||||
 | 
			
		||||
convert a node module into a browser require-able standalone file
 | 
			
		||||
-----------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Install the `traverse` package into `./node_modules`:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
npm install traverse
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Bundle everything up with browserify:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
$ npm install -g browserify
 | 
			
		||||
$ browserify -r traverse -o bundle.js
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Look at the files! There is a new one: `bundle.js`. Now go into HTML land:
 | 
			
		||||
 | 
			
		||||
``` html
 | 
			
		||||
<script src="bundle.js"></script>
 | 
			
		||||
<script>
 | 
			
		||||
   var traverse = require('traverse');
 | 
			
		||||
</script>
 | 
			
		||||
```
 | 
			
		||||
							
								
								
									
										219
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										219
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,219 @@
 | 
			
		||||
var require = function (file, cwd) {
 | 
			
		||||
    var resolved = require.resolve(file, cwd || '/');
 | 
			
		||||
    var mod = require.modules[resolved];
 | 
			
		||||
    if (!mod) throw new Error(
 | 
			
		||||
        'Failed to resolve module ' + file + ', tried ' + resolved
 | 
			
		||||
    );
 | 
			
		||||
    var res = mod._cached ? mod._cached : mod();
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
require.paths = [];
 | 
			
		||||
require.modules = {};
 | 
			
		||||
require.extensions = [".js",".coffee"];
 | 
			
		||||
 | 
			
		||||
require._core = {
 | 
			
		||||
    'assert': true,
 | 
			
		||||
    'events': true,
 | 
			
		||||
    'fs': true,
 | 
			
		||||
    'path': true,
 | 
			
		||||
    'vm': true
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.resolve = (function () {
 | 
			
		||||
    return function (x, cwd) {
 | 
			
		||||
        if (!cwd) cwd = '/';
 | 
			
		||||
        
 | 
			
		||||
        if (require._core[x]) return x;
 | 
			
		||||
        var path = require.modules.path();
 | 
			
		||||
        var y = cwd || '.';
 | 
			
		||||
        
 | 
			
		||||
        if (x.match(/^(?:\.\.?\/|\/)/)) {
 | 
			
		||||
            var m = loadAsFileSync(path.resolve(y, x))
 | 
			
		||||
                || loadAsDirectorySync(path.resolve(y, x));
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        var n = loadNodeModulesSync(x, y);
 | 
			
		||||
        if (n) return n;
 | 
			
		||||
        
 | 
			
		||||
        throw new Error("Cannot find module '" + x + "'");
 | 
			
		||||
        
 | 
			
		||||
        function loadAsFileSync (x) {
 | 
			
		||||
            if (require.modules[x]) {
 | 
			
		||||
                return x;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            for (var i = 0; i < require.extensions.length; i++) {
 | 
			
		||||
                var ext = require.extensions[i];
 | 
			
		||||
                if (require.modules[x + ext]) return x + ext;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadAsDirectorySync (x) {
 | 
			
		||||
            x = x.replace(/\/+$/, '');
 | 
			
		||||
            var pkgfile = x + '/package.json';
 | 
			
		||||
            if (require.modules[pkgfile]) {
 | 
			
		||||
                var pkg = require.modules[pkgfile]();
 | 
			
		||||
                var b = pkg.browserify;
 | 
			
		||||
                if (typeof b === 'object' && b.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (typeof b === 'string') {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (pkg.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, pkg.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return loadAsFileSync(x + '/index');
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadNodeModulesSync (x, start) {
 | 
			
		||||
            var dirs = nodeModulesPathsSync(start);
 | 
			
		||||
            for (var i = 0; i < dirs.length; i++) {
 | 
			
		||||
                var dir = dirs[i];
 | 
			
		||||
                var m = loadAsFileSync(dir + '/' + x);
 | 
			
		||||
                if (m) return m;
 | 
			
		||||
                var n = loadAsDirectorySync(dir + '/' + x);
 | 
			
		||||
                if (n) return n;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            var m = loadAsFileSync(x);
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function nodeModulesPathsSync (start) {
 | 
			
		||||
            var parts;
 | 
			
		||||
            if (start === '/') parts = [ '' ];
 | 
			
		||||
            else parts = path.normalize(start).split('/');
 | 
			
		||||
            
 | 
			
		||||
            var dirs = [];
 | 
			
		||||
            for (var i = parts.length - 1; i >= 0; i--) {
 | 
			
		||||
                if (parts[i] === 'node_modules') continue;
 | 
			
		||||
                var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
 | 
			
		||||
                dirs.push(dir);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return dirs;
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
require.alias = function (from, to) {
 | 
			
		||||
    var path = require.modules.path();
 | 
			
		||||
    var res = null;
 | 
			
		||||
    try {
 | 
			
		||||
        res = require.resolve(from + '/package.json', '/');
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        res = require.resolve(from, '/');
 | 
			
		||||
    }
 | 
			
		||||
    var basedir = path.dirname(res);
 | 
			
		||||
    
 | 
			
		||||
    var keys = (Object.keys || function (obj) {
 | 
			
		||||
        var res = [];
 | 
			
		||||
        for (var key in obj) res.push(key)
 | 
			
		||||
        return res;
 | 
			
		||||
    })(require.modules);
 | 
			
		||||
    
 | 
			
		||||
    for (var i = 0; i < keys.length; i++) {
 | 
			
		||||
        var key = keys[i];
 | 
			
		||||
        if (key.slice(0, basedir.length + 1) === basedir + '/') {
 | 
			
		||||
            var f = key.slice(basedir.length);
 | 
			
		||||
            require.modules[to + f] = require.modules[basedir + f];
 | 
			
		||||
        }
 | 
			
		||||
        else if (key === basedir) {
 | 
			
		||||
            require.modules[to] = require.modules[basedir];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.define = function (filename, fn) {
 | 
			
		||||
    var dirname = require._core[filename]
 | 
			
		||||
        ? ''
 | 
			
		||||
        : require.modules.path().dirname(filename)
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    var require_ = function (file) {
 | 
			
		||||
        return require(file, dirname)
 | 
			
		||||
    };
 | 
			
		||||
    require_.resolve = function (name) {
 | 
			
		||||
        return require.resolve(name, dirname);
 | 
			
		||||
    };
 | 
			
		||||
    require_.modules = require.modules;
 | 
			
		||||
    require_.define = require.define;
 | 
			
		||||
    var module_ = { exports : {} };
 | 
			
		||||
    
 | 
			
		||||
    require.modules[filename] = function () {
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        fn.call(
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            require_,
 | 
			
		||||
            module_,
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            dirname,
 | 
			
		||||
            filename
 | 
			
		||||
        );
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        return module_.exports;
 | 
			
		||||
    };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (typeof process === 'undefined') process = {};
 | 
			
		||||
 | 
			
		||||
if (!process.nextTick) process.nextTick = (function () {
 | 
			
		||||
    var queue = [];
 | 
			
		||||
    var canPost = typeof window !== 'undefined'
 | 
			
		||||
        && window.postMessage && window.addEventListener
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    if (canPost) {
 | 
			
		||||
        window.addEventListener('message', function (ev) {
 | 
			
		||||
            if (ev.source === window && ev.data === 'browserify-tick') {
 | 
			
		||||
                ev.stopPropagation();
 | 
			
		||||
                if (queue.length > 0) {
 | 
			
		||||
                    var fn = queue.shift();
 | 
			
		||||
                    fn();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }, true);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return function (fn) {
 | 
			
		||||
        if (canPost) {
 | 
			
		||||
            queue.push(fn);
 | 
			
		||||
            window.postMessage('browserify-tick', '*');
 | 
			
		||||
        }
 | 
			
		||||
        else setTimeout(fn, 0);
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
if (!process.title) process.title = 'browser';
 | 
			
		||||
 | 
			
		||||
if (!process.binding) process.binding = function (name) {
 | 
			
		||||
    if (name === 'evals') return require('vm')
 | 
			
		||||
    else throw new Error('No such module')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (!process.cwd) process.cwd = function () { return '.' };
 | 
			
		||||
 | 
			
		||||
require.define("path", Function(
 | 
			
		||||
    [ 'require', 'module', 'exports', '__dirname', '__filename' ],
 | 
			
		||||
    "function filter (xs, fn) {\n    var res = [];\n    for (var i = 0; i < xs.length; i++) {\n        if (fn(xs[i], i, xs)) res.push(xs[i]);\n    }\n    return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = parts.length; i >= 0; i--) {\n    var last = parts[i];\n    if (last == '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n    resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n  var path = (i >= 0)\n      ? arguments[i]\n      : process.cwd();\n\n  // Skip empty and invalid entries\n  if (typeof path !== 'string' || !path) {\n    continue;\n  }\n\n  resolvedPath = path + '/' + resolvedPath;\n  resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n    return !!p;\n  }), !resolvedAbsolute).join('/');\n\n  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n    trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n    return !!p;\n  }), !isAbsolute).join('/');\n\n  if (!path && !isAbsolute) {\n    path = '.';\n  }\n  if (path && trailingSlash) {\n    path += '/';\n  }\n  \n  return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n  var paths = Array.prototype.slice.call(arguments, 0);\n  return exports.normalize(filter(paths, function(p, index) {\n    return p && typeof p === 'string';\n  }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n  var dir = splitPathRe.exec(path)[1] || '';\n  var isWindows = false;\n  if (!dir) {\n    // No dirname\n    return '.';\n  } else if (dir.length === 1 ||\n      (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n    // It is just a slash or a drive letter with a slash\n    return dir;\n  } else {\n    // It is a full dirname, strip trailing slash\n    return dir.substring(0, dir.length - 1);\n  }\n};\n\n\nexports.basename = function(path, ext) {\n  var f = splitPathRe.exec(path)[2] || '';\n  // TODO: make this comparison case-insensitive on windows?\n  if (ext && f.substr(-1 * ext.length) === ext) {\n    f = f.substr(0, f.length - ext.length);\n  }\n  return f;\n};\n\n\nexports.extname = function(path) {\n  return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path"
 | 
			
		||||
));
 | 
			
		||||
 | 
			
		||||
require.define("/thrower.js", Function(
 | 
			
		||||
    [ 'require', 'module', 'exports', '__dirname', '__filename' ],
 | 
			
		||||
    "module.exports = function () {\n    throw 'beep';\n};\n\n//@ sourceURL=/thrower.js"
 | 
			
		||||
));
 | 
			
		||||
 | 
			
		||||
require.define("/entry.js", Function(
 | 
			
		||||
    [ 'require', 'module', 'exports', '__dirname', '__filename' ],
 | 
			
		||||
    "var thrower = require('./thrower');\nthrower();\n\n//@ sourceURL=/entry.js"
 | 
			
		||||
));
 | 
			
		||||
require("/entry.js");
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/build.sh
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/build.sh
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
browserify js/entry.js -v -o browserify.js --debug
 | 
			
		||||
							
								
								
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
    <script type="text/javascript" src="/browserify.js"></script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/js/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/js/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
var thrower = require('./thrower');
 | 
			
		||||
thrower();
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/js/thrower.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/js/thrower.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
module.exports = function () {
 | 
			
		||||
    throw 'beep';
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/debug/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
var connect = require('connect');
 | 
			
		||||
var server = connect.createServer();
 | 
			
		||||
 | 
			
		||||
server.use(connect.static(__dirname));
 | 
			
		||||
server.listen(8080);
 | 
			
		||||
console.log('Listening on :8080');
 | 
			
		||||
console.log('Make sure to run ./build.sh to generate browserify.js');
 | 
			
		||||
							
								
								
									
										368
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										368
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,368 @@
 | 
			
		||||
var require = function (file, cwd) {
 | 
			
		||||
    var resolved = require.resolve(file, cwd || '/');
 | 
			
		||||
    var mod = require.modules[resolved];
 | 
			
		||||
    if (!mod) throw new Error(
 | 
			
		||||
        'Failed to resolve module ' + file + ', tried ' + resolved
 | 
			
		||||
    );
 | 
			
		||||
    var res = mod._cached ? mod._cached : mod();
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
require.paths = [];
 | 
			
		||||
require.modules = {};
 | 
			
		||||
require.extensions = [".js",".coffee"];
 | 
			
		||||
 | 
			
		||||
require._core = {
 | 
			
		||||
    'assert': true,
 | 
			
		||||
    'events': true,
 | 
			
		||||
    'fs': true,
 | 
			
		||||
    'path': true,
 | 
			
		||||
    'vm': true
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.resolve = (function () {
 | 
			
		||||
    return function (x, cwd) {
 | 
			
		||||
        if (!cwd) cwd = '/';
 | 
			
		||||
        
 | 
			
		||||
        if (require._core[x]) return x;
 | 
			
		||||
        var path = require.modules.path();
 | 
			
		||||
        cwd = path.resolve('/', cwd);
 | 
			
		||||
        var y = cwd || '/';
 | 
			
		||||
        
 | 
			
		||||
        if (x.match(/^(?:\.\.?\/|\/)/)) {
 | 
			
		||||
            var m = loadAsFileSync(path.resolve(y, x))
 | 
			
		||||
                || loadAsDirectorySync(path.resolve(y, x));
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        var n = loadNodeModulesSync(x, y);
 | 
			
		||||
        if (n) return n;
 | 
			
		||||
        
 | 
			
		||||
        throw new Error("Cannot find module '" + x + "'");
 | 
			
		||||
        
 | 
			
		||||
        function loadAsFileSync (x) {
 | 
			
		||||
            if (require.modules[x]) {
 | 
			
		||||
                return x;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            for (var i = 0; i < require.extensions.length; i++) {
 | 
			
		||||
                var ext = require.extensions[i];
 | 
			
		||||
                if (require.modules[x + ext]) return x + ext;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadAsDirectorySync (x) {
 | 
			
		||||
            x = x.replace(/\/+$/, '');
 | 
			
		||||
            var pkgfile = x + '/package.json';
 | 
			
		||||
            if (require.modules[pkgfile]) {
 | 
			
		||||
                var pkg = require.modules[pkgfile]();
 | 
			
		||||
                var b = pkg.browserify;
 | 
			
		||||
                if (typeof b === 'object' && b.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (typeof b === 'string') {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (pkg.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, pkg.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return loadAsFileSync(x + '/index');
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadNodeModulesSync (x, start) {
 | 
			
		||||
            var dirs = nodeModulesPathsSync(start);
 | 
			
		||||
            for (var i = 0; i < dirs.length; i++) {
 | 
			
		||||
                var dir = dirs[i];
 | 
			
		||||
                var m = loadAsFileSync(dir + '/' + x);
 | 
			
		||||
                if (m) return m;
 | 
			
		||||
                var n = loadAsDirectorySync(dir + '/' + x);
 | 
			
		||||
                if (n) return n;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            var m = loadAsFileSync(x);
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function nodeModulesPathsSync (start) {
 | 
			
		||||
            var parts;
 | 
			
		||||
            if (start === '/') parts = [ '' ];
 | 
			
		||||
            else parts = path.normalize(start).split('/');
 | 
			
		||||
            
 | 
			
		||||
            var dirs = [];
 | 
			
		||||
            for (var i = parts.length - 1; i >= 0; i--) {
 | 
			
		||||
                if (parts[i] === 'node_modules') continue;
 | 
			
		||||
                var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
 | 
			
		||||
                dirs.push(dir);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return dirs;
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
require.alias = function (from, to) {
 | 
			
		||||
    var path = require.modules.path();
 | 
			
		||||
    var res = null;
 | 
			
		||||
    try {
 | 
			
		||||
        res = require.resolve(from + '/package.json', '/');
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        res = require.resolve(from, '/');
 | 
			
		||||
    }
 | 
			
		||||
    var basedir = path.dirname(res);
 | 
			
		||||
    
 | 
			
		||||
    var keys = (Object.keys || function (obj) {
 | 
			
		||||
        var res = [];
 | 
			
		||||
        for (var key in obj) res.push(key)
 | 
			
		||||
        return res;
 | 
			
		||||
    })(require.modules);
 | 
			
		||||
    
 | 
			
		||||
    for (var i = 0; i < keys.length; i++) {
 | 
			
		||||
        var key = keys[i];
 | 
			
		||||
        if (key.slice(0, basedir.length + 1) === basedir + '/') {
 | 
			
		||||
            var f = key.slice(basedir.length);
 | 
			
		||||
            require.modules[to + f] = require.modules[basedir + f];
 | 
			
		||||
        }
 | 
			
		||||
        else if (key === basedir) {
 | 
			
		||||
            require.modules[to] = require.modules[basedir];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.define = function (filename, fn) {
 | 
			
		||||
    var dirname = require._core[filename]
 | 
			
		||||
        ? ''
 | 
			
		||||
        : require.modules.path().dirname(filename)
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    var require_ = function (file) {
 | 
			
		||||
        return require(file, dirname)
 | 
			
		||||
    };
 | 
			
		||||
    require_.resolve = function (name) {
 | 
			
		||||
        return require.resolve(name, dirname);
 | 
			
		||||
    };
 | 
			
		||||
    require_.modules = require.modules;
 | 
			
		||||
    require_.define = require.define;
 | 
			
		||||
    var module_ = { exports : {} };
 | 
			
		||||
    
 | 
			
		||||
    require.modules[filename] = function () {
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        fn.call(
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            require_,
 | 
			
		||||
            module_,
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            dirname,
 | 
			
		||||
            filename
 | 
			
		||||
        );
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        return module_.exports;
 | 
			
		||||
    };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (typeof process === 'undefined') process = {};
 | 
			
		||||
 | 
			
		||||
if (!process.nextTick) process.nextTick = (function () {
 | 
			
		||||
    var queue = [];
 | 
			
		||||
    var canPost = typeof window !== 'undefined'
 | 
			
		||||
        && window.postMessage && window.addEventListener
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    if (canPost) {
 | 
			
		||||
        window.addEventListener('message', function (ev) {
 | 
			
		||||
            if (ev.source === window && ev.data === 'browserify-tick') {
 | 
			
		||||
                ev.stopPropagation();
 | 
			
		||||
                if (queue.length > 0) {
 | 
			
		||||
                    var fn = queue.shift();
 | 
			
		||||
                    fn();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }, true);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return function (fn) {
 | 
			
		||||
        if (canPost) {
 | 
			
		||||
            queue.push(fn);
 | 
			
		||||
            window.postMessage('browserify-tick', '*');
 | 
			
		||||
        }
 | 
			
		||||
        else setTimeout(fn, 0);
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
if (!process.title) process.title = 'browser';
 | 
			
		||||
 | 
			
		||||
if (!process.binding) process.binding = function (name) {
 | 
			
		||||
    if (name === 'evals') return require('vm')
 | 
			
		||||
    else throw new Error('No such module')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (!process.cwd) process.cwd = function () { return '.' };
 | 
			
		||||
 | 
			
		||||
require.define("path", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
function filter (xs, fn) {
 | 
			
		||||
    var res = [];
 | 
			
		||||
    for (var i = 0; i < xs.length; i++) {
 | 
			
		||||
        if (fn(xs[i], i, xs)) res.push(xs[i]);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// resolves . and .. elements in a path array with directory names there
 | 
			
		||||
// must be no slashes, empty elements, or device names (c:\) in the array
 | 
			
		||||
// (so also no leading and trailing slashes - it does not distinguish
 | 
			
		||||
// relative and absolute paths)
 | 
			
		||||
function normalizeArray(parts, allowAboveRoot) {
 | 
			
		||||
  // if the path tries to go above the root, `up` ends up > 0
 | 
			
		||||
  var up = 0;
 | 
			
		||||
  for (var i = parts.length; i >= 0; i--) {
 | 
			
		||||
    var last = parts[i];
 | 
			
		||||
    if (last == '.') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
    } else if (last === '..') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up++;
 | 
			
		||||
    } else if (up) {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up--;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // if the path is allowed to go above the root, restore leading ..s
 | 
			
		||||
  if (allowAboveRoot) {
 | 
			
		||||
    for (; up--; up) {
 | 
			
		||||
      parts.unshift('..');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return parts;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Regex to split a filename into [*, dir, basename, ext]
 | 
			
		||||
// posix version
 | 
			
		||||
var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
 | 
			
		||||
 | 
			
		||||
// path.resolve([from ...], to)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.resolve = function() {
 | 
			
		||||
var resolvedPath = '',
 | 
			
		||||
    resolvedAbsolute = false;
 | 
			
		||||
 | 
			
		||||
for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
 | 
			
		||||
  var path = (i >= 0)
 | 
			
		||||
      ? arguments[i]
 | 
			
		||||
      : process.cwd();
 | 
			
		||||
 | 
			
		||||
  // Skip empty and invalid entries
 | 
			
		||||
  if (typeof path !== 'string' || !path) {
 | 
			
		||||
    continue;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  resolvedPath = path + '/' + resolvedPath;
 | 
			
		||||
  resolvedAbsolute = path.charAt(0) === '/';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// At this point the path should be resolved to a full absolute path, but
 | 
			
		||||
// handle relative paths to be safe (might happen when process.cwd() fails)
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !resolvedAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// path.normalize(path)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.normalize = function(path) {
 | 
			
		||||
var isAbsolute = path.charAt(0) === '/',
 | 
			
		||||
    trailingSlash = path.slice(-1) === '/';
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
path = normalizeArray(filter(path.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !isAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  if (!path && !isAbsolute) {
 | 
			
		||||
    path = '.';
 | 
			
		||||
  }
 | 
			
		||||
  if (path && trailingSlash) {
 | 
			
		||||
    path += '/';
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  return (isAbsolute ? '/' : '') + path;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// posix version
 | 
			
		||||
exports.join = function() {
 | 
			
		||||
  var paths = Array.prototype.slice.call(arguments, 0);
 | 
			
		||||
  return exports.normalize(filter(paths, function(p, index) {
 | 
			
		||||
    return p && typeof p === 'string';
 | 
			
		||||
  }).join('/'));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.dirname = function(path) {
 | 
			
		||||
  var dir = splitPathRe.exec(path)[1] || '';
 | 
			
		||||
  var isWindows = false;
 | 
			
		||||
  if (!dir) {
 | 
			
		||||
    // No dirname
 | 
			
		||||
    return '.';
 | 
			
		||||
  } else if (dir.length === 1 ||
 | 
			
		||||
      (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
 | 
			
		||||
    // It is just a slash or a drive letter with a slash
 | 
			
		||||
    return dir;
 | 
			
		||||
  } else {
 | 
			
		||||
    // It is a full dirname, strip trailing slash
 | 
			
		||||
    return dir.substring(0, dir.length - 1);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.basename = function(path, ext) {
 | 
			
		||||
  var f = splitPathRe.exec(path)[2] || '';
 | 
			
		||||
  // TODO: make this comparison case-insensitive on windows?
 | 
			
		||||
  if (ext && f.substr(-1 * ext.length) === ext) {
 | 
			
		||||
    f = f.substr(0, f.length - ext.length);
 | 
			
		||||
  }
 | 
			
		||||
  return f;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.extname = function(path) {
 | 
			
		||||
  return splitPathRe.exec(path)[3] || '';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/foo.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
var bar = require('./bar');
 | 
			
		||||
 | 
			
		||||
module.exports = function (x) {
 | 
			
		||||
    return x * bar.coeff(x) + (x * 3 - 2)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/bar.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
exports.coeff = function (x) {
 | 
			
		||||
    return Math.log(x) / Math.log(2) + 1;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/entry.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
    var foo = require('./foo');
 | 
			
		||||
 | 
			
		||||
window.onload = function () {
 | 
			
		||||
    document.getElementById('result').innerHTML = foo(100);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
require("/entry.js");
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/build.sh
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/build.sh
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
browserify js/entry.js -v -o browserify.js
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
    <script type="text/javascript" src="/browserify.js"></script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    foo =
 | 
			
		||||
    <span style='font-family: monospace' id="result"></span>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/bar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/bar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
exports.coeff = function (x) {
 | 
			
		||||
    return Math.log(x) / Math.log(2) + 1;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
var foo = require('./foo');
 | 
			
		||||
 | 
			
		||||
window.onload = function () {
 | 
			
		||||
    document.getElementById('result').innerHTML = foo(100);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/foo.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/js/foo.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
var bar = require('./bar');
 | 
			
		||||
 | 
			
		||||
module.exports = function (x) {
 | 
			
		||||
    return x * bar.coeff(x) + (x * 3 - 2)
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/simple-build/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
var connect = require('connect');
 | 
			
		||||
var server = connect.createServer();
 | 
			
		||||
 | 
			
		||||
server.use(connect.static(__dirname));
 | 
			
		||||
server.listen(8080);
 | 
			
		||||
console.log('Listening on :8080');
 | 
			
		||||
console.log('Make sure to run ./build.sh to generate browserify.js');
 | 
			
		||||
							
								
								
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/b.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/b.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
var browserify = require('../../');
 | 
			
		||||
var b = browserify(__dirname + '/m.js');
 | 
			
		||||
b.addEntry(__dirname + '/n.js');
 | 
			
		||||
 | 
			
		||||
b.bundle().pipe(process.stdout);
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/bar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/bar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
module.exports = function (n) {
 | 
			
		||||
    return n * 11;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/foo.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/foo.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
module.exports = function (n) {
 | 
			
		||||
    return 10 + n * require('./bar')(n);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/m.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/m.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
var foo = require('./foo');
 | 
			
		||||
var bar = require('./bar');
 | 
			
		||||
console.log(foo(10));
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/n.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/test/n.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
var bar = require('./bar.js');
 | 
			
		||||
 | 
			
		||||
console.log('bar(5)=' + bar(5));
 | 
			
		||||
							
								
								
									
										813
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/bundle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										813
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/bundle.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,813 @@
 | 
			
		||||
var require = function (file, cwd) {
 | 
			
		||||
    var resolved = require.resolve(file, cwd || '/');
 | 
			
		||||
    var mod = require.modules[resolved];
 | 
			
		||||
    if (!mod) throw new Error(
 | 
			
		||||
        'Failed to resolve module ' + file + ', tried ' + resolved
 | 
			
		||||
    );
 | 
			
		||||
    var res = mod._cached ? mod._cached : mod();
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
require.paths = [];
 | 
			
		||||
require.modules = {};
 | 
			
		||||
require.extensions = [".js",".coffee"];
 | 
			
		||||
 | 
			
		||||
require._core = {
 | 
			
		||||
    'assert': true,
 | 
			
		||||
    'events': true,
 | 
			
		||||
    'fs': true,
 | 
			
		||||
    'path': true,
 | 
			
		||||
    'vm': true
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.resolve = (function () {
 | 
			
		||||
    return function (x, cwd) {
 | 
			
		||||
        if (!cwd) cwd = '/';
 | 
			
		||||
        
 | 
			
		||||
        if (require._core[x]) return x;
 | 
			
		||||
        var path = require.modules.path();
 | 
			
		||||
        cwd = path.resolve('/', cwd);
 | 
			
		||||
        var y = cwd || '/';
 | 
			
		||||
        
 | 
			
		||||
        if (x.match(/^(?:\.\.?\/|\/)/)) {
 | 
			
		||||
            var m = loadAsFileSync(path.resolve(y, x))
 | 
			
		||||
                || loadAsDirectorySync(path.resolve(y, x));
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        var n = loadNodeModulesSync(x, y);
 | 
			
		||||
        if (n) return n;
 | 
			
		||||
        
 | 
			
		||||
        throw new Error("Cannot find module '" + x + "'");
 | 
			
		||||
        
 | 
			
		||||
        function loadAsFileSync (x) {
 | 
			
		||||
            if (require.modules[x]) {
 | 
			
		||||
                return x;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            for (var i = 0; i < require.extensions.length; i++) {
 | 
			
		||||
                var ext = require.extensions[i];
 | 
			
		||||
                if (require.modules[x + ext]) return x + ext;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadAsDirectorySync (x) {
 | 
			
		||||
            x = x.replace(/\/+$/, '');
 | 
			
		||||
            var pkgfile = x + '/package.json';
 | 
			
		||||
            if (require.modules[pkgfile]) {
 | 
			
		||||
                var pkg = require.modules[pkgfile]();
 | 
			
		||||
                var b = pkg.browserify;
 | 
			
		||||
                if (typeof b === 'object' && b.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (typeof b === 'string') {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, b));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
                else if (pkg.main) {
 | 
			
		||||
                    var m = loadAsFileSync(path.resolve(x, pkg.main));
 | 
			
		||||
                    if (m) return m;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return loadAsFileSync(x + '/index');
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function loadNodeModulesSync (x, start) {
 | 
			
		||||
            var dirs = nodeModulesPathsSync(start);
 | 
			
		||||
            for (var i = 0; i < dirs.length; i++) {
 | 
			
		||||
                var dir = dirs[i];
 | 
			
		||||
                var m = loadAsFileSync(dir + '/' + x);
 | 
			
		||||
                if (m) return m;
 | 
			
		||||
                var n = loadAsDirectorySync(dir + '/' + x);
 | 
			
		||||
                if (n) return n;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            var m = loadAsFileSync(x);
 | 
			
		||||
            if (m) return m;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        function nodeModulesPathsSync (start) {
 | 
			
		||||
            var parts;
 | 
			
		||||
            if (start === '/') parts = [ '' ];
 | 
			
		||||
            else parts = path.normalize(start).split('/');
 | 
			
		||||
            
 | 
			
		||||
            var dirs = [];
 | 
			
		||||
            for (var i = parts.length - 1; i >= 0; i--) {
 | 
			
		||||
                if (parts[i] === 'node_modules') continue;
 | 
			
		||||
                var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
 | 
			
		||||
                dirs.push(dir);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return dirs;
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
require.alias = function (from, to) {
 | 
			
		||||
    var path = require.modules.path();
 | 
			
		||||
    var res = null;
 | 
			
		||||
    try {
 | 
			
		||||
        res = require.resolve(from + '/package.json', '/');
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        res = require.resolve(from, '/');
 | 
			
		||||
    }
 | 
			
		||||
    var basedir = path.dirname(res);
 | 
			
		||||
    
 | 
			
		||||
    var keys = (Object.keys || function (obj) {
 | 
			
		||||
        var res = [];
 | 
			
		||||
        for (var key in obj) res.push(key)
 | 
			
		||||
        return res;
 | 
			
		||||
    })(require.modules);
 | 
			
		||||
    
 | 
			
		||||
    for (var i = 0; i < keys.length; i++) {
 | 
			
		||||
        var key = keys[i];
 | 
			
		||||
        if (key.slice(0, basedir.length + 1) === basedir + '/') {
 | 
			
		||||
            var f = key.slice(basedir.length);
 | 
			
		||||
            require.modules[to + f] = require.modules[basedir + f];
 | 
			
		||||
        }
 | 
			
		||||
        else if (key === basedir) {
 | 
			
		||||
            require.modules[to] = require.modules[basedir];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
require.define = function (filename, fn) {
 | 
			
		||||
    var dirname = require._core[filename]
 | 
			
		||||
        ? ''
 | 
			
		||||
        : require.modules.path().dirname(filename)
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    var require_ = function (file) {
 | 
			
		||||
        return require(file, dirname)
 | 
			
		||||
    };
 | 
			
		||||
    require_.resolve = function (name) {
 | 
			
		||||
        return require.resolve(name, dirname);
 | 
			
		||||
    };
 | 
			
		||||
    require_.modules = require.modules;
 | 
			
		||||
    require_.define = require.define;
 | 
			
		||||
    var module_ = { exports : {} };
 | 
			
		||||
    
 | 
			
		||||
    require.modules[filename] = function () {
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        fn.call(
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            require_,
 | 
			
		||||
            module_,
 | 
			
		||||
            module_.exports,
 | 
			
		||||
            dirname,
 | 
			
		||||
            filename
 | 
			
		||||
        );
 | 
			
		||||
        require.modules[filename]._cached = module_.exports;
 | 
			
		||||
        return module_.exports;
 | 
			
		||||
    };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (typeof process === 'undefined') process = {};
 | 
			
		||||
 | 
			
		||||
if (!process.nextTick) process.nextTick = (function () {
 | 
			
		||||
    var queue = [];
 | 
			
		||||
    var canPost = typeof window !== 'undefined'
 | 
			
		||||
        && window.postMessage && window.addEventListener
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    if (canPost) {
 | 
			
		||||
        window.addEventListener('message', function (ev) {
 | 
			
		||||
            if (ev.source === window && ev.data === 'browserify-tick') {
 | 
			
		||||
                ev.stopPropagation();
 | 
			
		||||
                if (queue.length > 0) {
 | 
			
		||||
                    var fn = queue.shift();
 | 
			
		||||
                    fn();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }, true);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return function (fn) {
 | 
			
		||||
        if (canPost) {
 | 
			
		||||
            queue.push(fn);
 | 
			
		||||
            window.postMessage('browserify-tick', '*');
 | 
			
		||||
        }
 | 
			
		||||
        else setTimeout(fn, 0);
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
if (!process.title) process.title = 'browser';
 | 
			
		||||
 | 
			
		||||
if (!process.binding) process.binding = function (name) {
 | 
			
		||||
    if (name === 'evals') return require('vm')
 | 
			
		||||
    else throw new Error('No such module')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (!process.cwd) process.cwd = function () { return '.' };
 | 
			
		||||
 | 
			
		||||
require.define("path", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
function filter (xs, fn) {
 | 
			
		||||
    var res = [];
 | 
			
		||||
    for (var i = 0; i < xs.length; i++) {
 | 
			
		||||
        if (fn(xs[i], i, xs)) res.push(xs[i]);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// resolves . and .. elements in a path array with directory names there
 | 
			
		||||
// must be no slashes, empty elements, or device names (c:\) in the array
 | 
			
		||||
// (so also no leading and trailing slashes - it does not distinguish
 | 
			
		||||
// relative and absolute paths)
 | 
			
		||||
function normalizeArray(parts, allowAboveRoot) {
 | 
			
		||||
  // if the path tries to go above the root, `up` ends up > 0
 | 
			
		||||
  var up = 0;
 | 
			
		||||
  for (var i = parts.length; i >= 0; i--) {
 | 
			
		||||
    var last = parts[i];
 | 
			
		||||
    if (last == '.') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
    } else if (last === '..') {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up++;
 | 
			
		||||
    } else if (up) {
 | 
			
		||||
      parts.splice(i, 1);
 | 
			
		||||
      up--;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // if the path is allowed to go above the root, restore leading ..s
 | 
			
		||||
  if (allowAboveRoot) {
 | 
			
		||||
    for (; up--; up) {
 | 
			
		||||
      parts.unshift('..');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return parts;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Regex to split a filename into [*, dir, basename, ext]
 | 
			
		||||
// posix version
 | 
			
		||||
var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
 | 
			
		||||
 | 
			
		||||
// path.resolve([from ...], to)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.resolve = function() {
 | 
			
		||||
var resolvedPath = '',
 | 
			
		||||
    resolvedAbsolute = false;
 | 
			
		||||
 | 
			
		||||
for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
 | 
			
		||||
  var path = (i >= 0)
 | 
			
		||||
      ? arguments[i]
 | 
			
		||||
      : process.cwd();
 | 
			
		||||
 | 
			
		||||
  // Skip empty and invalid entries
 | 
			
		||||
  if (typeof path !== 'string' || !path) {
 | 
			
		||||
    continue;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  resolvedPath = path + '/' + resolvedPath;
 | 
			
		||||
  resolvedAbsolute = path.charAt(0) === '/';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// At this point the path should be resolved to a full absolute path, but
 | 
			
		||||
// handle relative paths to be safe (might happen when process.cwd() fails)
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !resolvedAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// path.normalize(path)
 | 
			
		||||
// posix version
 | 
			
		||||
exports.normalize = function(path) {
 | 
			
		||||
var isAbsolute = path.charAt(0) === '/',
 | 
			
		||||
    trailingSlash = path.slice(-1) === '/';
 | 
			
		||||
 | 
			
		||||
// Normalize the path
 | 
			
		||||
path = normalizeArray(filter(path.split('/'), function(p) {
 | 
			
		||||
    return !!p;
 | 
			
		||||
  }), !isAbsolute).join('/');
 | 
			
		||||
 | 
			
		||||
  if (!path && !isAbsolute) {
 | 
			
		||||
    path = '.';
 | 
			
		||||
  }
 | 
			
		||||
  if (path && trailingSlash) {
 | 
			
		||||
    path += '/';
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  return (isAbsolute ? '/' : '') + path;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// posix version
 | 
			
		||||
exports.join = function() {
 | 
			
		||||
  var paths = Array.prototype.slice.call(arguments, 0);
 | 
			
		||||
  return exports.normalize(filter(paths, function(p, index) {
 | 
			
		||||
    return p && typeof p === 'string';
 | 
			
		||||
  }).join('/'));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.dirname = function(path) {
 | 
			
		||||
  var dir = splitPathRe.exec(path)[1] || '';
 | 
			
		||||
  var isWindows = false;
 | 
			
		||||
  if (!dir) {
 | 
			
		||||
    // No dirname
 | 
			
		||||
    return '.';
 | 
			
		||||
  } else if (dir.length === 1 ||
 | 
			
		||||
      (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
 | 
			
		||||
    // It is just a slash or a drive letter with a slash
 | 
			
		||||
    return dir;
 | 
			
		||||
  } else {
 | 
			
		||||
    // It is a full dirname, strip trailing slash
 | 
			
		||||
    return dir.substring(0, dir.length - 1);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.basename = function(path, ext) {
 | 
			
		||||
  var f = splitPathRe.exec(path)[2] || '';
 | 
			
		||||
  // TODO: make this comparison case-insensitive on windows?
 | 
			
		||||
  if (ext && f.substr(-1 * ext.length) === ext) {
 | 
			
		||||
    f = f.substr(0, f.length - ext.length);
 | 
			
		||||
  }
 | 
			
		||||
  return f;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.extname = function(path) {
 | 
			
		||||
  return splitPathRe.exec(path)[3] || '';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("http", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
module.exports = require("http-browserify")
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/node_modules/http-browserify/package.json", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
module.exports = {"main":"index.js","browserify":"index.js"}
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/node_modules/http-browserify/index.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
var http = module.exports;
 | 
			
		||||
var EventEmitter = require('events').EventEmitter;
 | 
			
		||||
var Request = require('./lib/request');
 | 
			
		||||
 | 
			
		||||
http.request = function (params, cb) {
 | 
			
		||||
    if (!params) params = {};
 | 
			
		||||
    if (!params.host) params.host = window.location.host.split(':')[0];
 | 
			
		||||
    if (!params.port) params.port = window.location.port;
 | 
			
		||||
    
 | 
			
		||||
    var req = new Request(new xhrHttp, params);
 | 
			
		||||
    if (cb) req.on('response', cb);
 | 
			
		||||
    return req;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
http.get = function (params, cb) {
 | 
			
		||||
    params.method = 'GET';
 | 
			
		||||
    var req = http.request(params, cb);
 | 
			
		||||
    req.end();
 | 
			
		||||
    return req;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var xhrHttp = (function () {
 | 
			
		||||
    if (typeof window === 'undefined') {
 | 
			
		||||
        throw new Error('no window object present');
 | 
			
		||||
    }
 | 
			
		||||
    else if (window.XMLHttpRequest) {
 | 
			
		||||
        return window.XMLHttpRequest;
 | 
			
		||||
    }
 | 
			
		||||
    else if (window.ActiveXObject) {
 | 
			
		||||
        var axs = [
 | 
			
		||||
            'Msxml2.XMLHTTP.6.0',
 | 
			
		||||
            'Msxml2.XMLHTTP.3.0',
 | 
			
		||||
            'Microsoft.XMLHTTP'
 | 
			
		||||
        ];
 | 
			
		||||
        for (var i = 0; i < axs.length; i++) {
 | 
			
		||||
            try {
 | 
			
		||||
                var ax = new(window.ActiveXObject)(axs[i]);
 | 
			
		||||
                return function () {
 | 
			
		||||
                    if (ax) {
 | 
			
		||||
                        var ax_ = ax;
 | 
			
		||||
                        ax = null;
 | 
			
		||||
                        return ax_;
 | 
			
		||||
                    }
 | 
			
		||||
                    else {
 | 
			
		||||
                        return new(window.ActiveXObject)(axs[i]);
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
            catch (e) {}
 | 
			
		||||
        }
 | 
			
		||||
        throw new Error('ajax not supported in this browser')
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        throw new Error('ajax not supported in this browser');
 | 
			
		||||
    }
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("events", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
if (!process.EventEmitter) process.EventEmitter = function () {};
 | 
			
		||||
 | 
			
		||||
var EventEmitter = exports.EventEmitter = process.EventEmitter;
 | 
			
		||||
var isArray = typeof Array.isArray === 'function'
 | 
			
		||||
    ? Array.isArray
 | 
			
		||||
    : function (xs) {
 | 
			
		||||
        return Object.toString.call(xs) === '[object Array]'
 | 
			
		||||
    }
 | 
			
		||||
;
 | 
			
		||||
 | 
			
		||||
// By default EventEmitters will print a warning if more than
 | 
			
		||||
// 10 listeners are added to it. This is a useful default which
 | 
			
		||||
// helps finding memory leaks.
 | 
			
		||||
//
 | 
			
		||||
// Obviously not all Emitters should be limited to 10. This function allows
 | 
			
		||||
// that to be increased. Set to zero for unlimited.
 | 
			
		||||
var defaultMaxListeners = 10;
 | 
			
		||||
EventEmitter.prototype.setMaxListeners = function(n) {
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
  this._events.maxListeners = n;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.emit = function(type) {
 | 
			
		||||
  // If there is no 'error' event listener then throw.
 | 
			
		||||
  if (type === 'error') {
 | 
			
		||||
    if (!this._events || !this._events.error ||
 | 
			
		||||
        (isArray(this._events.error) && !this._events.error.length))
 | 
			
		||||
    {
 | 
			
		||||
      if (arguments[1] instanceof Error) {
 | 
			
		||||
        throw arguments[1]; // Unhandled 'error' event
 | 
			
		||||
      } else {
 | 
			
		||||
        throw new Error("Uncaught, unspecified 'error' event.");
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!this._events) return false;
 | 
			
		||||
  var handler = this._events[type];
 | 
			
		||||
  if (!handler) return false;
 | 
			
		||||
 | 
			
		||||
  if (typeof handler == 'function') {
 | 
			
		||||
    switch (arguments.length) {
 | 
			
		||||
      // fast cases
 | 
			
		||||
      case 1:
 | 
			
		||||
        handler.call(this);
 | 
			
		||||
        break;
 | 
			
		||||
      case 2:
 | 
			
		||||
        handler.call(this, arguments[1]);
 | 
			
		||||
        break;
 | 
			
		||||
      case 3:
 | 
			
		||||
        handler.call(this, arguments[1], arguments[2]);
 | 
			
		||||
        break;
 | 
			
		||||
      // slower
 | 
			
		||||
      default:
 | 
			
		||||
        var args = Array.prototype.slice.call(arguments, 1);
 | 
			
		||||
        handler.apply(this, args);
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  } else if (isArray(handler)) {
 | 
			
		||||
    var args = Array.prototype.slice.call(arguments, 1);
 | 
			
		||||
 | 
			
		||||
    var listeners = handler.slice();
 | 
			
		||||
    for (var i = 0, l = listeners.length; i < l; i++) {
 | 
			
		||||
      listeners[i].apply(this, args);
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
  } else {
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// EventEmitter is defined in src/node_events.cc
 | 
			
		||||
// EventEmitter.prototype.emit() is also defined there.
 | 
			
		||||
EventEmitter.prototype.addListener = function(type, listener) {
 | 
			
		||||
  if ('function' !== typeof listener) {
 | 
			
		||||
    throw new Error('addListener only takes instances of Function');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
 | 
			
		||||
  // To avoid recursion in the case that type == "newListeners"! Before
 | 
			
		||||
  // adding it to the listeners, first emit "newListeners".
 | 
			
		||||
  this.emit('newListener', type, listener);
 | 
			
		||||
 | 
			
		||||
  if (!this._events[type]) {
 | 
			
		||||
    // Optimize the case of one listener. Don't need the extra array object.
 | 
			
		||||
    this._events[type] = listener;
 | 
			
		||||
  } else if (isArray(this._events[type])) {
 | 
			
		||||
 | 
			
		||||
    // Check for listener leak
 | 
			
		||||
    if (!this._events[type].warned) {
 | 
			
		||||
      var m;
 | 
			
		||||
      if (this._events.maxListeners !== undefined) {
 | 
			
		||||
        m = this._events.maxListeners;
 | 
			
		||||
      } else {
 | 
			
		||||
        m = defaultMaxListeners;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (m && m > 0 && this._events[type].length > m) {
 | 
			
		||||
        this._events[type].warned = true;
 | 
			
		||||
        console.error('(node) warning: possible EventEmitter memory ' +
 | 
			
		||||
                      'leak detected. %d listeners added. ' +
 | 
			
		||||
                      'Use emitter.setMaxListeners() to increase limit.',
 | 
			
		||||
                      this._events[type].length);
 | 
			
		||||
        console.trace();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // If we've already got an array, just append.
 | 
			
		||||
    this._events[type].push(listener);
 | 
			
		||||
  } else {
 | 
			
		||||
    // Adding the second element, need to change to array.
 | 
			
		||||
    this._events[type] = [this._events[type], listener];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.once = function(type, listener) {
 | 
			
		||||
  var self = this;
 | 
			
		||||
  self.on(type, function g() {
 | 
			
		||||
    self.removeListener(type, g);
 | 
			
		||||
    listener.apply(this, arguments);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.removeListener = function(type, listener) {
 | 
			
		||||
  if ('function' !== typeof listener) {
 | 
			
		||||
    throw new Error('removeListener only takes instances of Function');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // does not use listeners(), so no side effect of creating _events[type]
 | 
			
		||||
  if (!this._events || !this._events[type]) return this;
 | 
			
		||||
 | 
			
		||||
  var list = this._events[type];
 | 
			
		||||
 | 
			
		||||
  if (isArray(list)) {
 | 
			
		||||
    var i = list.indexOf(listener);
 | 
			
		||||
    if (i < 0) return this;
 | 
			
		||||
    list.splice(i, 1);
 | 
			
		||||
    if (list.length == 0)
 | 
			
		||||
      delete this._events[type];
 | 
			
		||||
  } else if (this._events[type] === listener) {
 | 
			
		||||
    delete this._events[type];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.removeAllListeners = function(type) {
 | 
			
		||||
  // does not use listeners(), so no side effect of creating _events[type]
 | 
			
		||||
  if (type && this._events && this._events[type]) this._events[type] = null;
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
EventEmitter.prototype.listeners = function(type) {
 | 
			
		||||
  if (!this._events) this._events = {};
 | 
			
		||||
  if (!this._events[type]) this._events[type] = [];
 | 
			
		||||
  if (!isArray(this._events[type])) {
 | 
			
		||||
    this._events[type] = [this._events[type]];
 | 
			
		||||
  }
 | 
			
		||||
  return this._events[type];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/node_modules/http-browserify/lib/request.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
var EventEmitter = require('events').EventEmitter;
 | 
			
		||||
var Response = require('./response');
 | 
			
		||||
 | 
			
		||||
var Request = module.exports = function (xhr, params) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    self.xhr = xhr;
 | 
			
		||||
    self.body = '';
 | 
			
		||||
    
 | 
			
		||||
    var uri = params.host + ':' + params.port + (params.path || '/');
 | 
			
		||||
    
 | 
			
		||||
    xhr.open(
 | 
			
		||||
        params.method || 'GET',
 | 
			
		||||
        (params.scheme || 'http') + '://' + uri,
 | 
			
		||||
        true
 | 
			
		||||
    );
 | 
			
		||||
    
 | 
			
		||||
    if (params.headers) {
 | 
			
		||||
        Object.keys(params.headers).forEach(function (key) {
 | 
			
		||||
            if (!self.isSafeRequestHeader(key)) return;
 | 
			
		||||
            var value = params.headers[key];
 | 
			
		||||
            if (Array.isArray(value)) {
 | 
			
		||||
                value.forEach(function (v) {
 | 
			
		||||
                    xhr.setRequestHeader(key, v);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
            else xhr.setRequestHeader(key, value)
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    var res = new Response;
 | 
			
		||||
    res.on('ready', function () {
 | 
			
		||||
        self.emit('response', res);
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    xhr.onreadystatechange = function () {
 | 
			
		||||
        res.handle(xhr);
 | 
			
		||||
    };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Request.prototype = new EventEmitter;
 | 
			
		||||
 | 
			
		||||
Request.prototype.setHeader = function (key, value) {
 | 
			
		||||
    if ((Array.isArray && Array.isArray(value))
 | 
			
		||||
    || value instanceof Array) {
 | 
			
		||||
        for (var i = 0; i < value.length; i++) {
 | 
			
		||||
            this.xhr.setRequestHeader(key, value[i]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        this.xhr.setRequestHeader(key, value);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Request.prototype.write = function (s) {
 | 
			
		||||
    this.body += s;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Request.prototype.end = function (s) {
 | 
			
		||||
    if (s !== undefined) this.write(s);
 | 
			
		||||
    this.xhr.send(this.body);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Taken from http://dxr.mozilla.org/mozilla/mozilla-central/content/base/src/nsXMLHttpRequest.cpp.html
 | 
			
		||||
Request.unsafeHeaders = [
 | 
			
		||||
    "accept-charset",
 | 
			
		||||
    "accept-encoding",
 | 
			
		||||
    "access-control-request-headers",
 | 
			
		||||
    "access-control-request-method",
 | 
			
		||||
    "connection",
 | 
			
		||||
    "content-length",
 | 
			
		||||
    "cookie",
 | 
			
		||||
    "cookie2",
 | 
			
		||||
    "content-transfer-encoding",
 | 
			
		||||
    "date",
 | 
			
		||||
    "expect",
 | 
			
		||||
    "host",
 | 
			
		||||
    "keep-alive",
 | 
			
		||||
    "origin",
 | 
			
		||||
    "referer",
 | 
			
		||||
    "te",
 | 
			
		||||
    "trailer",
 | 
			
		||||
    "transfer-encoding",
 | 
			
		||||
    "upgrade",
 | 
			
		||||
    "user-agent",
 | 
			
		||||
    "via"
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
Request.prototype.isSafeRequestHeader = function (headerName) {
 | 
			
		||||
    if (!headerName) return false;
 | 
			
		||||
    return (Request.unsafeHeaders.indexOf(headerName.toLowerCase()) === -1)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/node_modules/http-browserify/lib/response.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
var EventEmitter = require('events').EventEmitter;
 | 
			
		||||
 | 
			
		||||
var Response = module.exports = function (res) {
 | 
			
		||||
    this.offset = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Response.prototype = new EventEmitter;
 | 
			
		||||
 | 
			
		||||
var capable = {
 | 
			
		||||
    streaming : true,
 | 
			
		||||
    status2 : true
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function parseHeaders (res) {
 | 
			
		||||
    var lines = res.getAllResponseHeaders().split(/\r?\n/);
 | 
			
		||||
    var headers = {};
 | 
			
		||||
    for (var i = 0; i < lines.length; i++) {
 | 
			
		||||
        var line = lines[i];
 | 
			
		||||
        if (line === '') continue;
 | 
			
		||||
        
 | 
			
		||||
        var m = line.match(/^([^:]+):\s*(.*)/);
 | 
			
		||||
        if (m) {
 | 
			
		||||
            var key = m[1].toLowerCase(), value = m[2];
 | 
			
		||||
            
 | 
			
		||||
            if (headers[key] !== undefined) {
 | 
			
		||||
                if ((Array.isArray && Array.isArray(headers[key]))
 | 
			
		||||
                || headers[key] instanceof Array) {
 | 
			
		||||
                    headers[key].push(value);
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    headers[key] = [ headers[key], value ];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                headers[key] = value;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            headers[line] = true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return headers;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Response.prototype.getHeader = function (key) {
 | 
			
		||||
    return this.headers[key.toLowerCase()];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Response.prototype.handle = function (res) {
 | 
			
		||||
    if (res.readyState === 2 && capable.status2) {
 | 
			
		||||
        try {
 | 
			
		||||
            this.statusCode = res.status;
 | 
			
		||||
            this.headers = parseHeaders(res);
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {
 | 
			
		||||
            capable.status2 = false;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if (capable.status2) {
 | 
			
		||||
            this.emit('ready');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (capable.streaming && res.readyState === 3) {
 | 
			
		||||
        try {
 | 
			
		||||
            if (!this.statusCode) {
 | 
			
		||||
                this.statusCode = res.status;
 | 
			
		||||
                this.headers = parseHeaders(res);
 | 
			
		||||
                this.emit('ready');
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {}
 | 
			
		||||
        
 | 
			
		||||
        try {
 | 
			
		||||
            this.write(res);
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {
 | 
			
		||||
            capable.streaming = false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (res.readyState === 4) {
 | 
			
		||||
        if (!this.statusCode) {
 | 
			
		||||
            this.statusCode = res.status;
 | 
			
		||||
            this.emit('ready');
 | 
			
		||||
        }
 | 
			
		||||
        this.write(res);
 | 
			
		||||
        
 | 
			
		||||
        if (res.error) {
 | 
			
		||||
            this.emit('error', res.responseText);
 | 
			
		||||
        }
 | 
			
		||||
        else this.emit('end');
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Response.prototype.write = function (res) {
 | 
			
		||||
    if (res.responseText.length > this.offset) {
 | 
			
		||||
        this.emit('data', res.responseText.slice(this.offset));
 | 
			
		||||
        this.offset = res.responseText.length;
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
require.define("/entry.js", function (require, module, exports, __dirname, __filename) {
 | 
			
		||||
    var http = require('http');
 | 
			
		||||
 | 
			
		||||
$(function () {
 | 
			
		||||
    var opts = {
 | 
			
		||||
        host : window.location.hostname,
 | 
			
		||||
        port : window.location.port,
 | 
			
		||||
        path : '/count'
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    http.get(opts, function (res) {
 | 
			
		||||
        res.on('data', function (buf) {
 | 
			
		||||
            $('<div>')
 | 
			
		||||
                .text(buf)
 | 
			
		||||
                .appendTo($('#count'))
 | 
			
		||||
            ;
 | 
			
		||||
        });
 | 
			
		||||
        
 | 
			
		||||
        res.on('end', function () {
 | 
			
		||||
            $('<div>')
 | 
			
		||||
                .text('__END__')
 | 
			
		||||
                .appendTo($('#count'))
 | 
			
		||||
            ;
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
require("/entry.js");
 | 
			
		||||
							
								
								
									
										25
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/entry.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
var http = require('http');
 | 
			
		||||
 | 
			
		||||
$(function () {
 | 
			
		||||
    var opts = {
 | 
			
		||||
        host : window.location.hostname,
 | 
			
		||||
        port : window.location.port,
 | 
			
		||||
        path : '/count'
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    http.get(opts, function (res) {
 | 
			
		||||
        res.on('data', function (buf) {
 | 
			
		||||
            $('<div>')
 | 
			
		||||
                .text(buf)
 | 
			
		||||
                .appendTo($('#count'))
 | 
			
		||||
            ;
 | 
			
		||||
        });
 | 
			
		||||
        
 | 
			
		||||
        res.on('end', function () {
 | 
			
		||||
            $('<div>')
 | 
			
		||||
                .text('__END__')
 | 
			
		||||
                .appendTo($('#count'))
 | 
			
		||||
            ;
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/index.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <head>
 | 
			
		||||
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 | 
			
		||||
    <script src="/bundle.js"></script>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <div id="count"></div>
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										28
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								node_modules/filesystem-browserify/node_modules/browserify/example/using-http/server.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
var http = require('http');
 | 
			
		||||
var ecstatic = require('ecstatic')(__dirname);
 | 
			
		||||
 | 
			
		||||
var server = http.createServer(function (req, res) {
 | 
			
		||||
    if (req.url === '/count') {
 | 
			
		||||
        res.setHeader('content-type', 'multipart/octet-stream');
 | 
			
		||||
        
 | 
			
		||||
        var n = 10;
 | 
			
		||||
        var iv = setInterval(function () {
 | 
			
		||||
            res.write(n + '\r\n');
 | 
			
		||||
            
 | 
			
		||||
            if (--n === 0) {
 | 
			
		||||
                clearInterval(iv);
 | 
			
		||||
                res.end();
 | 
			
		||||
            }
 | 
			
		||||
        }, 250);
 | 
			
		||||
    }
 | 
			
		||||
    else ecstatic(req, res)
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
server.listen(8001);
 | 
			
		||||
console.log([
 | 
			
		||||
    'Listening on :8001',
 | 
			
		||||
    '',
 | 
			
		||||
    'To compile the build, do:',
 | 
			
		||||
    '    browserify entry.js -o bundle.js'
 | 
			
		||||
].join('\n'));
 | 
			
		||||
							
								
								
									
										202
									
								
								node_modules/filesystem-browserify/node_modules/browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										202
									
								
								node_modules/filesystem-browserify/node_modules/browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,202 @@
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var coffee = require('coffee-script');
 | 
			
		||||
var EventEmitter = require('events').EventEmitter;
 | 
			
		||||
 | 
			
		||||
var wrap = require('./lib/wrap');
 | 
			
		||||
var watch = require('./lib/watch');
 | 
			
		||||
 | 
			
		||||
function idFromPath (path) {
 | 
			
		||||
    return path.replace(/\\/g, '/');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isAbsolute (pathOrId) {
 | 
			
		||||
    return path.normalize(pathOrId) === path.normalize(path.resolve(pathOrId));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function needsNodeModulesPrepended (id) {
 | 
			
		||||
    return !/^[.\/]/.test(id) && !isAbsolute(id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var exports = module.exports = function (entryFile, opts) {
 | 
			
		||||
    if (!opts) opts = {};
 | 
			
		||||
    
 | 
			
		||||
    if (Array.isArray(entryFile)) {
 | 
			
		||||
        if (Array.isArray(opts.entry)) {
 | 
			
		||||
            opts.entry.unshift.apply(opts.entry, entryFile);
 | 
			
		||||
        }
 | 
			
		||||
        else if (opts.entry) {
 | 
			
		||||
            opts.entry = entryFile.concat(opts.entry);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            opts.entry = entryFile;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (typeof entryFile === 'object') {
 | 
			
		||||
        opts = entryFile;
 | 
			
		||||
    }
 | 
			
		||||
    else if (typeof entryFile === 'string') {
 | 
			
		||||
        if (Array.isArray(opts.entry)) {
 | 
			
		||||
            opts.entry.unshift(entryFile);
 | 
			
		||||
        }
 | 
			
		||||
        else if (opts.entry) {
 | 
			
		||||
            opts.entry = [ opts.entry, entryFile ];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            opts.entry = entryFile;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    var opts_ = {
 | 
			
		||||
        cache : opts.cache,
 | 
			
		||||
        debug : opts.debug,
 | 
			
		||||
        exports : opts.exports,
 | 
			
		||||
    };
 | 
			
		||||
    var w = wrap(opts_);
 | 
			
		||||
    w.register('.coffee', function (body, file) {
 | 
			
		||||
        try {
 | 
			
		||||
            var res = coffee.compile(body, { filename : file });
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {
 | 
			
		||||
            w.emit('syntaxError', err);
 | 
			
		||||
        }
 | 
			
		||||
        return res;
 | 
			
		||||
    });
 | 
			
		||||
    w.register('.json', function (body, file) {
 | 
			
		||||
        return 'module.exports = ' + body + ';\n';
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    var listening = false;
 | 
			
		||||
    w._cache = null;
 | 
			
		||||
    
 | 
			
		||||
    var self = function (req, res, next) {
 | 
			
		||||
        if (!listening && req.connection && req.connection.server) {
 | 
			
		||||
            req.connection.server.on('close', function () {
 | 
			
		||||
                self.end();
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        listening = true;
 | 
			
		||||
        
 | 
			
		||||
        if (req.url.split('?')[0] === (opts.mount || '/browserify.js')) {
 | 
			
		||||
            if (!w._cache) self.bundle();
 | 
			
		||||
            res.statusCode = 200;
 | 
			
		||||
            res.setHeader('last-modified', self.modified.toString());
 | 
			
		||||
            res.setHeader('content-type', 'text/javascript');
 | 
			
		||||
            res.end(w._cache);
 | 
			
		||||
        }
 | 
			
		||||
        else next()
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    if (opts.watch) watch(w, opts.watch);
 | 
			
		||||
    
 | 
			
		||||
    if (opts.filter) {
 | 
			
		||||
        w.register('post', function (body) {
 | 
			
		||||
            return opts.filter(body);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    w.ignore(opts.ignore || []);
 | 
			
		||||
    
 | 
			
		||||
    if (opts.require) {
 | 
			
		||||
        if (Array.isArray(opts.require)) {
 | 
			
		||||
            opts.require.forEach(function (r) {
 | 
			
		||||
                r = idFromPath(r);
 | 
			
		||||
 | 
			
		||||
                var params = {};
 | 
			
		||||
                if (needsNodeModulesPrepended(r)) {
 | 
			
		||||
                    params.target = '/node_modules/' + r + '/index.js';
 | 
			
		||||
                }
 | 
			
		||||
                w.require(r, params);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else if (typeof opts.require === 'object') {
 | 
			
		||||
            Object.keys(opts.require).forEach(function (key) {
 | 
			
		||||
                opts.require[key] = idFromPath(opts.require[key]);
 | 
			
		||||
 | 
			
		||||
                var params = {};
 | 
			
		||||
                if (needsNodeModulesPrepended(opts.require[key])) {
 | 
			
		||||
                    params.target = '/node_modules/'
 | 
			
		||||
                        + opts.require[key] + '/index.js'
 | 
			
		||||
                    ;
 | 
			
		||||
                }
 | 
			
		||||
                w.require(opts.require[key], params);
 | 
			
		||||
                w.alias(key, opts.require[key]);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            opts.require = idFromPath(opts.require);
 | 
			
		||||
 | 
			
		||||
            var params = {};
 | 
			
		||||
            if (needsNodeModulesPrepended(opts.require)) {
 | 
			
		||||
                params.target = '/node_modules/'
 | 
			
		||||
                    + opts.require + '/index.js'
 | 
			
		||||
                ;
 | 
			
		||||
            }
 | 
			
		||||
            w.require(opts.require, params);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (opts.entry) {
 | 
			
		||||
        if (Array.isArray(opts.entry)) {
 | 
			
		||||
            opts.entry.forEach(function (e) {
 | 
			
		||||
                w.addEntry(e);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            w.addEntry(opts.entry);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    Object.keys(w).forEach(function (key) {
 | 
			
		||||
        Object.defineProperty(self, key, {
 | 
			
		||||
            set : function (value) { w[key] = value },
 | 
			
		||||
            get : function () { return w[key] }
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    Object.keys(Object.getPrototypeOf(w)).forEach(function (key) {
 | 
			
		||||
        self[key] = function () {
 | 
			
		||||
            var s = w[key].apply(self, arguments)
 | 
			
		||||
            if (s === self) { w._cache = null }
 | 
			
		||||
            return s;
 | 
			
		||||
        };
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    Object.keys(EventEmitter.prototype).forEach(function (key) {
 | 
			
		||||
        if (typeof w[key] === 'function' && w[key].bind) {
 | 
			
		||||
            self[key] = w[key].bind(w);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            self[key] = w[key];
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    var firstBundle = true;
 | 
			
		||||
    self.modified = new Date;
 | 
			
		||||
    
 | 
			
		||||
    self.bundle = function () {
 | 
			
		||||
        if (w._cache) return w._cache;
 | 
			
		||||
        
 | 
			
		||||
        var src = w.bundle.apply(w, arguments);
 | 
			
		||||
        self.ok = Object.keys(w.errors).length === 0;
 | 
			
		||||
        
 | 
			
		||||
        if (!firstBundle) {
 | 
			
		||||
            self.modified = new Date;
 | 
			
		||||
        }
 | 
			
		||||
        firstBundle = false;
 | 
			
		||||
        
 | 
			
		||||
        w._cache = src;
 | 
			
		||||
        return src;
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    self.end = function () {
 | 
			
		||||
        Object.keys(w.watches || {}).forEach(function (file) {
 | 
			
		||||
            w.watches[file].close();
 | 
			
		||||
        });
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    return self;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.bundle = function (opts) {
 | 
			
		||||
    return exports(opts).bundle();
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										75
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/watch.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/watch.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,75 @@
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var exists = fs.exists || path.exists;
 | 
			
		||||
 | 
			
		||||
module.exports = function (w, opts) { 
 | 
			
		||||
    if (!w.watches) w.watches = [];
 | 
			
		||||
    w.register(reg.bind(null, w, opts));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function reg (w, opts, body, file) {
 | 
			
		||||
    // if already being watched
 | 
			
		||||
    if (w.watches[file]) return body;
 | 
			
		||||
    
 | 
			
		||||
    var type = w.files[file] ? 'files' : 'entries';
 | 
			
		||||
    
 | 
			
		||||
    var watch = function () {
 | 
			
		||||
        if (w.files[file] && w.files[file].synthetic) return;
 | 
			
		||||
        
 | 
			
		||||
        if (typeof opts === 'object') {
 | 
			
		||||
            w.watches[file] = fs.watch(file, opts, watcher);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            w.watches[file] = fs.watch(file, watcher);
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
    var pending = null;
 | 
			
		||||
    var bundle = function () {
 | 
			
		||||
        if (pending) return;
 | 
			
		||||
        pending = setTimeout(function () {
 | 
			
		||||
            pending = null;
 | 
			
		||||
            // modified
 | 
			
		||||
            if (w[type][file]) {
 | 
			
		||||
                w.reload(file);
 | 
			
		||||
            }
 | 
			
		||||
            else if (type === 'entries') {
 | 
			
		||||
                w.addEntry(file);
 | 
			
		||||
            }
 | 
			
		||||
            else if (type === 'files') {
 | 
			
		||||
                w.require(file);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            w._cache = null;
 | 
			
		||||
            w.emit('bundle');
 | 
			
		||||
        }, 100);
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    var watcher = function (event, filename) {
 | 
			
		||||
        exists(file, function (ex) {
 | 
			
		||||
            if (!ex) {
 | 
			
		||||
                // deleted
 | 
			
		||||
                if (w.files[file]) {
 | 
			
		||||
                    delete w.files[file];
 | 
			
		||||
                }
 | 
			
		||||
                else if (w.entries[file] !== undefined) {
 | 
			
		||||
                    w.appends.splice(w.entries[file], 1);
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
                w._cache = null;
 | 
			
		||||
            }
 | 
			
		||||
            else if (event === 'change') {
 | 
			
		||||
                bundle();
 | 
			
		||||
            }
 | 
			
		||||
            else if (event === 'rename') {
 | 
			
		||||
                w.watches[file].close();
 | 
			
		||||
                process.nextTick(watch);
 | 
			
		||||
                bundle();
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    w.watches[file] = true;
 | 
			
		||||
    process.nextTick(watch);
 | 
			
		||||
    
 | 
			
		||||
    return body;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										580
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/wrap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										580
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/wrap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,580 @@
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var util = require('util');
 | 
			
		||||
var EventEmitter = require('events').EventEmitter;
 | 
			
		||||
 | 
			
		||||
var detective = require('detective');
 | 
			
		||||
var deputy = require('deputy');
 | 
			
		||||
var resolve = require('resolve');
 | 
			
		||||
 | 
			
		||||
var wrappers = require('./wrappers');
 | 
			
		||||
var commondir = require('commondir');
 | 
			
		||||
var nub = require('nub');
 | 
			
		||||
var checkSyntax = require('syntax-error');
 | 
			
		||||
 | 
			
		||||
var existsSync = fs.existsSync || path.existsSync;
 | 
			
		||||
var sep = path.sep || (process.platform === 'win32' ? '\\' : '/');
 | 
			
		||||
 | 
			
		||||
module.exports = function (opts) {
 | 
			
		||||
    return new Wrap(opts);
 | 
			
		||||
};
 | 
			
		||||
function idFromPath (path) {
 | 
			
		||||
    return path.replace(/\\/g, '/');
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
function Wrap (opts) {
 | 
			
		||||
    var home = process.env.HOME || process.env.USERPROFILE;
 | 
			
		||||
    if (opts.cache === undefined && home !== undefined) {
 | 
			
		||||
        opts.cache = true;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (opts.cache) {
 | 
			
		||||
        if (typeof opts.cache === 'boolean') {
 | 
			
		||||
            var file = home + '/.config/browserify/cache.json';
 | 
			
		||||
            this.detective = deputy(file);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            this.detective = deputy(opts.cache);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        this.detective = detective;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    this.exports = opts.exports;
 | 
			
		||||
    
 | 
			
		||||
    this.files = {};
 | 
			
		||||
    this.filters = [];
 | 
			
		||||
    this.pathFilters = [];
 | 
			
		||||
    this.postFilters = [];
 | 
			
		||||
    this.preFilters = [];
 | 
			
		||||
    this.aliases = {};
 | 
			
		||||
    this._checkedPackages = {};
 | 
			
		||||
    this.errors = {};
 | 
			
		||||
    
 | 
			
		||||
    this.ignoring = {};
 | 
			
		||||
    this.extensions = [ '.js' ];
 | 
			
		||||
    
 | 
			
		||||
    this.prepends = [ wrappers.prelude, wrappers.process ];
 | 
			
		||||
    this.appends = []
 | 
			
		||||
    this.entries = {};
 | 
			
		||||
    this.debug = opts.debug;
 | 
			
		||||
    
 | 
			
		||||
    this.require('path');
 | 
			
		||||
    this.require('__browserify_process');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function resolveMod(from, to){
 | 
			
		||||
    // not a real directory on the filesystem; just using the path
 | 
			
		||||
    // module to get rid of the filename.
 | 
			
		||||
    var targetDir = path.dirname(from);
 | 
			
		||||
    // not a real filename; just using the path module to deal with
 | 
			
		||||
    // relative paths.
 | 
			
		||||
    var reqFilename = path.resolve(targetDir, to);
 | 
			
		||||
    // get rid of drive letter on Windows; replace it with '/'
 | 
			
		||||
    var reqFilenameWithoutDriveLetter = /^[a-zA-Z]:\\/.test(reqFilename) ?
 | 
			
		||||
        '/' + reqFilename.substring(3) : reqFilename;
 | 
			
		||||
 | 
			
		||||
    return reqFilenameWithoutDriveLetter;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
util.inherits(Wrap, EventEmitter);
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.prepend = function (src) {
 | 
			
		||||
    this.prepends.unshift(src);
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.append = function (src) {
 | 
			
		||||
    this.appends.push(src);
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.ignore = function (files) {
 | 
			
		||||
    if (!files) files = [];
 | 
			
		||||
    if (!Array.isArray(files)) files = [ files ];
 | 
			
		||||
    
 | 
			
		||||
    this.ignoring = files.reduce(function (acc,x) {
 | 
			
		||||
        acc[x] = true;
 | 
			
		||||
        return acc;
 | 
			
		||||
    }, this.ignoring);
 | 
			
		||||
    
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.use = function (fn) {
 | 
			
		||||
    fn(this, this);
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.register = function (ext, fn) {
 | 
			
		||||
    if (typeof ext === 'object') {
 | 
			
		||||
        fn = ext.wrapper;
 | 
			
		||||
        ext = ext.extension;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (ext === 'post') {
 | 
			
		||||
        this.postFilters.push(fn);
 | 
			
		||||
    }
 | 
			
		||||
    else if (ext === 'pre') {
 | 
			
		||||
        this.preFilters.push(fn);
 | 
			
		||||
    }
 | 
			
		||||
    else if (ext === 'path') {
 | 
			
		||||
        this.pathFilters.push(fn);
 | 
			
		||||
    }
 | 
			
		||||
    else if (fn) {
 | 
			
		||||
        this.extensions.push(ext);
 | 
			
		||||
        this.filters.push(function (body, file) {
 | 
			
		||||
            if (file.slice(-ext.length) === ext) {
 | 
			
		||||
                return fn.call(this, body, file);
 | 
			
		||||
            }
 | 
			
		||||
            else return body;
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        this.filters.push(ext);
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.reload = function (file) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    delete self.errors[file];
 | 
			
		||||
    
 | 
			
		||||
    if (self.files[file]) {
 | 
			
		||||
        var f = self.files[file];
 | 
			
		||||
        f.body = undefined;
 | 
			
		||||
        delete self.files[file];
 | 
			
		||||
        
 | 
			
		||||
        self.require(file, f);
 | 
			
		||||
    }
 | 
			
		||||
    else if (self.entries[file]) {
 | 
			
		||||
        var e = self.entries[file];
 | 
			
		||||
        e.body = undefined;
 | 
			
		||||
        delete self.entries[file];
 | 
			
		||||
        
 | 
			
		||||
        self.addEntry(file, e);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return self;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.readFile = function (file) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    
 | 
			
		||||
    self.pathFilters.forEach(function (fn) {
 | 
			
		||||
        file = fn.call(self, file);
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    var body = fs.readFileSync(file, 'utf8').replace(/^#![^\n]*\n/, '');
 | 
			
		||||
    
 | 
			
		||||
    self.filters.forEach(function (fn) {
 | 
			
		||||
        body = fn.call(self, body, file);
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    var err = checkSyntax(body, file); 
 | 
			
		||||
    if (err) {
 | 
			
		||||
        self.errors[file] = err;
 | 
			
		||||
        
 | 
			
		||||
        process.nextTick(function () {
 | 
			
		||||
            self.emit('syntaxError', err);
 | 
			
		||||
        });
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        delete self.errors[file];
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return body;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.alias = function (to, from) {
 | 
			
		||||
    this.aliases[to] = from;
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.addEntry = function (file_, opts) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    if (!opts) opts = {};
 | 
			
		||||
    var file = path.resolve(opts.dirname || process.cwd(), file_);
 | 
			
		||||
    
 | 
			
		||||
    var entry = this.entries[file] = {};
 | 
			
		||||
    // entry must be set before readFile for the watch
 | 
			
		||||
    var body = entry.body = opts.body || self.readFile(file);
 | 
			
		||||
    if (body === undefined) return self;
 | 
			
		||||
    
 | 
			
		||||
    if (opts.target) entry.target = opts.target;
 | 
			
		||||
    
 | 
			
		||||
    try {
 | 
			
		||||
        var required = self.detective.find(body);
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        process.nextTick(function () {
 | 
			
		||||
            err.message = 'Error while loading entry file '
 | 
			
		||||
                + JSON.stringify(file)
 | 
			
		||||
                + ': ' + err.message
 | 
			
		||||
            ;
 | 
			
		||||
            self.emit('syntaxError', err);
 | 
			
		||||
        });
 | 
			
		||||
        return self;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (required.expressions.length) {
 | 
			
		||||
        console.error('Expressions in require() statements:');
 | 
			
		||||
        required.expressions.forEach(function (ex) {
 | 
			
		||||
            console.error('    require(' + ex + ')');
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    var dirname = path.dirname(file);
 | 
			
		||||
    
 | 
			
		||||
    required.strings.forEach(function (req) {
 | 
			
		||||
        var params = {
 | 
			
		||||
            dirname : dirname,
 | 
			
		||||
            fromFile : file,
 | 
			
		||||
        };
 | 
			
		||||
        if (opts.target && /^[.\/]/.test(req)) {
 | 
			
		||||
            params.target = resolveMod(opts.target, req);
 | 
			
		||||
        }
 | 
			
		||||
        self.require(req, params);
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.bundle = function () {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    
 | 
			
		||||
    for (var i = 0; i < self.prepends.length; i++) {
 | 
			
		||||
        var p = self.prepends[i];
 | 
			
		||||
        if (p === wrappers.prelude) {
 | 
			
		||||
            self.prepends[i] = p.replace(/\$extensions/, function () {
 | 
			
		||||
                return JSON.stringify(self.extensions);
 | 
			
		||||
            });
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    this.preFilters.forEach((function (fn) {
 | 
			
		||||
        fn.call(this, this);
 | 
			
		||||
    }).bind(this));
 | 
			
		||||
    
 | 
			
		||||
    (function () {
 | 
			
		||||
        // hack to set -browserify module targets
 | 
			
		||||
        var nm = path.resolve(__dirname, '../node_modules');
 | 
			
		||||
        Object.keys(self.files).forEach(function (file) {
 | 
			
		||||
            if (file.substring(0, nm.length) !== nm) return;
 | 
			
		||||
            var relativeToNm = path.relative(nm, file);
 | 
			
		||||
            var topDir = relativeToNm.split(sep)[0];
 | 
			
		||||
            if (!/-browserify$/.test(topDir)) return;
 | 
			
		||||
            self.files[file].target = path.join('/', 'node_modules', relativeToNm);
 | 
			
		||||
        });
 | 
			
		||||
    })();
 | 
			
		||||
    
 | 
			
		||||
    var basedir = (function () {
 | 
			
		||||
        var required = Object.keys(self.files)
 | 
			
		||||
            .filter(function (x) {
 | 
			
		||||
                return !self.files[x].target;
 | 
			
		||||
            })
 | 
			
		||||
        ;
 | 
			
		||||
        var entries = Object.keys(self.entries)
 | 
			
		||||
            .filter(function (x) { return !self.entries[x].target })
 | 
			
		||||
        ;
 | 
			
		||||
        var files = required.concat(entries)
 | 
			
		||||
            .map(function (x) { return path.dirname(x) })
 | 
			
		||||
        ;
 | 
			
		||||
        if (files.length === 0) return '';
 | 
			
		||||
        
 | 
			
		||||
        var dir = commondir(files) + '/';
 | 
			
		||||
        return path.normalize(dir.replace(/\/node_modules\/$/, '/'));
 | 
			
		||||
    })();
 | 
			
		||||
    
 | 
			
		||||
    var removeLeading = function (s) {
 | 
			
		||||
        if (s.slice(0, basedir.length) === basedir) {
 | 
			
		||||
            return s.slice(basedir.length - 1);
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    var src = []
 | 
			
		||||
        .concat(this.prepends)
 | 
			
		||||
        .concat(Object.keys(self.files).map(function (file) {
 | 
			
		||||
            var s = self.files[file];
 | 
			
		||||
            var target = s.target || removeLeading(file);
 | 
			
		||||
            
 | 
			
		||||
            if (self.ignoring[target]) return '';
 | 
			
		||||
            
 | 
			
		||||
            return self.wrap(idFromPath(target), s.body)
 | 
			
		||||
        }))
 | 
			
		||||
        .concat(Object.keys(self.aliases).map(function (to) {
 | 
			
		||||
            var from = self.aliases[to];
 | 
			
		||||
            if (!to.match(/^(\.\.?)?\//)) {
 | 
			
		||||
                to = '/node_modules/' + to;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            return wrappers.alias
 | 
			
		||||
                .replace(/\$from/, function () {
 | 
			
		||||
                    return JSON.stringify(from);
 | 
			
		||||
                })
 | 
			
		||||
                .replace(/\$to/, function () {
 | 
			
		||||
                    return JSON.stringify(to);
 | 
			
		||||
                })
 | 
			
		||||
            ;
 | 
			
		||||
        }))
 | 
			
		||||
        .concat(Object.keys(self.entries).map(function (file) {
 | 
			
		||||
            var s = self.entries[file];
 | 
			
		||||
            var target = s.target || removeLeading(file);
 | 
			
		||||
            return self.wrapEntry(idFromPath(target), s.body);
 | 
			
		||||
        }))
 | 
			
		||||
        .concat(this.appends)
 | 
			
		||||
        .join('\n')
 | 
			
		||||
    ;
 | 
			
		||||
    
 | 
			
		||||
    if (!self.exports) {
 | 
			
		||||
        self.exports = Object.keys(self.entries).length ? [] : [ 'require' ];
 | 
			
		||||
    }
 | 
			
		||||
    if (self.exports === true) self.exports = [ 'require', 'process' ];
 | 
			
		||||
    if (!Array.isArray(self.exports)) self.exports = [ self.exports ];
 | 
			
		||||
    
 | 
			
		||||
    if (self.exports.indexOf('process') >= 0
 | 
			
		||||
    && self.exports.indexOf('require') >= 0) {
 | 
			
		||||
        src += 'var process = require("__browserify_process");\n'
 | 
			
		||||
    }
 | 
			
		||||
    else if (self.exports.indexOf('require') >= 0) {
 | 
			
		||||
        // nop
 | 
			
		||||
    }
 | 
			
		||||
    else if (self.exports.indexOf('process') >= 0) {
 | 
			
		||||
        src = 'var process = (function(){'
 | 
			
		||||
            + src
 | 
			
		||||
            + ';return require("__browserify_process")'
 | 
			
		||||
            + '})();\n'
 | 
			
		||||
        ;
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        src = '(function(){' + src + '})();\n'
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    this.postFilters.forEach((function (fn) {
 | 
			
		||||
        src = fn.call(this, src);
 | 
			
		||||
    }).bind(this));
 | 
			
		||||
    
 | 
			
		||||
    return src;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.wrap = function (target, body) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    return (self.debug ? wrappers.body_debug : wrappers.body)
 | 
			
		||||
        .replace(/\$__filename/g, function () {
 | 
			
		||||
            return JSON.stringify(target);
 | 
			
		||||
        })
 | 
			
		||||
        .replace(/\$body/, function () {
 | 
			
		||||
            return self.debug
 | 
			
		||||
                ? JSON.stringify(body + '\n//@ sourceURL=' + target)
 | 
			
		||||
                : body
 | 
			
		||||
            ;
 | 
			
		||||
        })
 | 
			
		||||
    ;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.wrapEntry = function (target, body) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    return (self.debug ? wrappers.entry_debug : wrappers.entry)
 | 
			
		||||
        .replace(/\$__filename/g, function () {
 | 
			
		||||
            return JSON.stringify(target)
 | 
			
		||||
        })
 | 
			
		||||
        .replace(/\$body/, function () {
 | 
			
		||||
            return self.debug
 | 
			
		||||
                ? JSON.stringify(body + '\n//@ sourceURL=' + target)
 | 
			
		||||
                : body
 | 
			
		||||
            ;
 | 
			
		||||
        })
 | 
			
		||||
    ;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.include = function (file, target, body, root) {
 | 
			
		||||
    var synthetic = !file;
 | 
			
		||||
    if (!file) file = Math.floor(Math.random() * Math.pow(2,32)).toString(16);
 | 
			
		||||
    
 | 
			
		||||
    this.files[file] = {
 | 
			
		||||
        body : body,
 | 
			
		||||
        target : target,
 | 
			
		||||
        synthetic : synthetic,
 | 
			
		||||
        root : root
 | 
			
		||||
    };
 | 
			
		||||
    return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.require = function (mfile, opts) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    if (!opts) opts = {};
 | 
			
		||||
    if (!opts.dirname) opts.dirname = process.cwd();
 | 
			
		||||
    
 | 
			
		||||
    if (typeof mfile === 'object') {
 | 
			
		||||
        throw new Error('require maps no longer supported');
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (self.has(mfile)) return self;
 | 
			
		||||
    if (opts.target && self.has(opts.target)) return self;
 | 
			
		||||
    
 | 
			
		||||
    if (self.ignoring[mfile]) return self;
 | 
			
		||||
    if (self.aliases[mfile]) return self;
 | 
			
		||||
    
 | 
			
		||||
    function moduleError (msg) {
 | 
			
		||||
        return new Error(msg + ': ' + JSON.stringify(mfile)
 | 
			
		||||
            + ' from directory ' + JSON.stringify(opts.dirname)
 | 
			
		||||
            + (opts.fromFile ? ' while processing file ' + opts.fromFile : '')
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    var pkg = {};
 | 
			
		||||
    if (mfile === '__browserify_process' || resolve.isCore(mfile)) {
 | 
			
		||||
        opts.file = path.resolve(__dirname, '../builtins/' + mfile + '.js');
 | 
			
		||||
        opts.target = opts.target || mfile;
 | 
			
		||||
        
 | 
			
		||||
        if (!existsSync(opts.file)) {
 | 
			
		||||
            try {
 | 
			
		||||
                require.resolve(mfile + '-browserify');
 | 
			
		||||
                opts.body = 'module.exports = require('
 | 
			
		||||
                    + JSON.stringify(mfile + '-browserify')
 | 
			
		||||
                + ')';
 | 
			
		||||
            }
 | 
			
		||||
            catch (err) {
 | 
			
		||||
                throw moduleError('No wrapper for core module');
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (self.has(mfile)) {
 | 
			
		||||
        // package has already been included in some fashion, no need to resolve
 | 
			
		||||
        return self;
 | 
			
		||||
    }
 | 
			
		||||
    else if (opts.body) {
 | 
			
		||||
        opts.file = mfile;
 | 
			
		||||
    }
 | 
			
		||||
    else if (!opts.file) {
 | 
			
		||||
        try {
 | 
			
		||||
            var normPath
 | 
			
		||||
                = path.normalize(path.resolve(mfile)) === path.normalize(mfile)
 | 
			
		||||
                ? path.normalize(mfile) : mfile
 | 
			
		||||
            ;
 | 
			
		||||
            opts.file = self.resolver(normPath, opts.dirname);
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {
 | 
			
		||||
            throw moduleError('Cannot find module');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (self.has(opts.file)) return self;
 | 
			
		||||
    
 | 
			
		||||
    var dirname = path.dirname(opts.file);
 | 
			
		||||
    var pkgfile = path.join(dirname, 'package.json');
 | 
			
		||||
    
 | 
			
		||||
    if (!mfile.match(/^(\.\.?)?\//)) {
 | 
			
		||||
        try {
 | 
			
		||||
            pkgfile = resolve.sync(path.join(mfile, 'package.json'), {
 | 
			
		||||
                basedir : dirname
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        catch (err) {}
 | 
			
		||||
    }
 | 
			
		||||
     
 | 
			
		||||
    if (pkgfile && !self._checkedPackages[pkgfile]) {
 | 
			
		||||
        self._checkedPackages[pkgfile] = true;
 | 
			
		||||
        if (existsSync(pkgfile)) {
 | 
			
		||||
            var pkgBody = fs.readFileSync(pkgfile, 'utf8');
 | 
			
		||||
            try {
 | 
			
		||||
                var npmpkg = JSON.parse(pkgBody);
 | 
			
		||||
                if (npmpkg.main !== undefined) {
 | 
			
		||||
                    pkg.main = npmpkg.main;
 | 
			
		||||
                }
 | 
			
		||||
                if (npmpkg.browserify !== undefined) {
 | 
			
		||||
                    pkg.browserify = npmpkg.browserify;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            catch (err) {
 | 
			
		||||
                // ignore broken package.jsons just like node
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            self.files[pkgfile] = {
 | 
			
		||||
                body : 'module.exports = ' + JSON.stringify(pkg),
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var entry = self.files[opts.file] = {
 | 
			
		||||
        target : opts.target
 | 
			
		||||
    };
 | 
			
		||||
    // entry must be set before readFile for the watch
 | 
			
		||||
    var body = entry.body = opts.body || self.readFile(opts.file);
 | 
			
		||||
    if (body === undefined) {
 | 
			
		||||
        delete self.files[opts.file];
 | 
			
		||||
        return self;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    try {
 | 
			
		||||
        var required = self.detective.find(body);
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        process.nextTick(function () {
 | 
			
		||||
            self.emit('syntaxError', err);
 | 
			
		||||
        });
 | 
			
		||||
        return self;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (pkg.browserify && pkg.browserify.require) {
 | 
			
		||||
        required.strings = required.strings.concat(
 | 
			
		||||
            pkg.browserify.require
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (required.expressions.length) {
 | 
			
		||||
        console.error('Expressions in require() statements:');
 | 
			
		||||
        required.expressions.forEach(function (ex) {
 | 
			
		||||
            console.error('    require(' + ex + ')');
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    nub(required.strings).forEach(function (req) {
 | 
			
		||||
        var params = {
 | 
			
		||||
            dirname : dirname,
 | 
			
		||||
            fromFile : opts.file,
 | 
			
		||||
        };
 | 
			
		||||
        if (opts.target && /^[.\/]/.test(req)) {
 | 
			
		||||
            params.target = idFromPath(resolveMod(opts.target, req));
 | 
			
		||||
        }
 | 
			
		||||
        self.require(req, params);
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    return self;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function isPrefixOf (x, y) {
 | 
			
		||||
    return y.slice(0, x.length) === x;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.has = function (file) {
 | 
			
		||||
    var self = this;
 | 
			
		||||
    if (self.files[file]) return true;
 | 
			
		||||
    
 | 
			
		||||
    var res = Object.keys(self.files).some(function (key) {
 | 
			
		||||
        return self.files[key].target === file;
 | 
			
		||||
    });
 | 
			
		||||
    return res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Wrap.prototype.resolver = function (file, basedir) {
 | 
			
		||||
    return resolve.sync(file, {
 | 
			
		||||
        basedir : basedir,
 | 
			
		||||
        extensions : this.extensions,
 | 
			
		||||
        packageFilter : function (pkg) {
 | 
			
		||||
            var b = pkg.browserify;
 | 
			
		||||
            if (b) {
 | 
			
		||||
                if (typeof b === 'string') {
 | 
			
		||||
                    pkg.main = b;
 | 
			
		||||
                }
 | 
			
		||||
                else if (typeof b === 'object' && b.main) {
 | 
			
		||||
                    pkg.main = b.main;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return pkg
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/wrappers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								node_modules/filesystem-browserify/node_modules/browserify/lib/wrappers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
 | 
			
		||||
module.exports = fs.readdirSync(__dirname + '/../wrappers')
 | 
			
		||||
    .filter(function (file) { return file.match(/\.js$/) })
 | 
			
		||||
    .reduce(function (acc, file) {
 | 
			
		||||
        var name = file.replace(/\.js$/, '');
 | 
			
		||||
        acc[name] = fs.readFileSync(__dirname + '/../wrappers/' + file, 'utf8');
 | 
			
		||||
        return acc;
 | 
			
		||||
    }, {})
 | 
			
		||||
;
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/.bin/cake
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/.bin/cake
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
../coffee-script/bin/cake
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/.bin/coffee
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/.bin/coffee
									
									
									
										generated
									
									
										vendored
									
									
										Symbolic link
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
../coffee-script/bin/coffee
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
node_modules
 | 
			
		||||
							
								
								
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
buffer-browserify
 | 
			
		||||
===============
 | 
			
		||||
 | 
			
		||||
The buffer module from [node.js](http://nodejs.org/),
 | 
			
		||||
but for browsers.
 | 
			
		||||
 | 
			
		||||
When you `require('buffer')` in
 | 
			
		||||
[browserify](http://github.com/substack/node-browserify),
 | 
			
		||||
this module will be loaded.
 | 
			
		||||
 | 
			
		||||
It will also be loaded if you use the global `Buffer` variable.
 | 
			
		||||
							
								
								
									
										84
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/buffer_ieee754.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/buffer_ieee754.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) {
 | 
			
		||||
  var e, m,
 | 
			
		||||
      eLen = nBytes * 8 - mLen - 1,
 | 
			
		||||
      eMax = (1 << eLen) - 1,
 | 
			
		||||
      eBias = eMax >> 1,
 | 
			
		||||
      nBits = -7,
 | 
			
		||||
      i = isBE ? 0 : (nBytes - 1),
 | 
			
		||||
      d = isBE ? 1 : -1,
 | 
			
		||||
      s = buffer[offset + i];
 | 
			
		||||
 | 
			
		||||
  i += d;
 | 
			
		||||
 | 
			
		||||
  e = s & ((1 << (-nBits)) - 1);
 | 
			
		||||
  s >>= (-nBits);
 | 
			
		||||
  nBits += eLen;
 | 
			
		||||
  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
 | 
			
		||||
 | 
			
		||||
  m = e & ((1 << (-nBits)) - 1);
 | 
			
		||||
  e >>= (-nBits);
 | 
			
		||||
  nBits += mLen;
 | 
			
		||||
  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
 | 
			
		||||
 | 
			
		||||
  if (e === 0) {
 | 
			
		||||
    e = 1 - eBias;
 | 
			
		||||
  } else if (e === eMax) {
 | 
			
		||||
    return m ? NaN : ((s ? -1 : 1) * Infinity);
 | 
			
		||||
  } else {
 | 
			
		||||
    m = m + Math.pow(2, mLen);
 | 
			
		||||
    e = e - eBias;
 | 
			
		||||
  }
 | 
			
		||||
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) {
 | 
			
		||||
  var e, m, c,
 | 
			
		||||
      eLen = nBytes * 8 - mLen - 1,
 | 
			
		||||
      eMax = (1 << eLen) - 1,
 | 
			
		||||
      eBias = eMax >> 1,
 | 
			
		||||
      rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
 | 
			
		||||
      i = isBE ? (nBytes - 1) : 0,
 | 
			
		||||
      d = isBE ? -1 : 1,
 | 
			
		||||
      s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
 | 
			
		||||
 | 
			
		||||
  value = Math.abs(value);
 | 
			
		||||
 | 
			
		||||
  if (isNaN(value) || value === Infinity) {
 | 
			
		||||
    m = isNaN(value) ? 1 : 0;
 | 
			
		||||
    e = eMax;
 | 
			
		||||
  } else {
 | 
			
		||||
    e = Math.floor(Math.log(value) / Math.LN2);
 | 
			
		||||
    if (value * (c = Math.pow(2, -e)) < 1) {
 | 
			
		||||
      e--;
 | 
			
		||||
      c *= 2;
 | 
			
		||||
    }
 | 
			
		||||
    if (e + eBias >= 1) {
 | 
			
		||||
      value += rt / c;
 | 
			
		||||
    } else {
 | 
			
		||||
      value += rt * Math.pow(2, 1 - eBias);
 | 
			
		||||
    }
 | 
			
		||||
    if (value * c >= 2) {
 | 
			
		||||
      e++;
 | 
			
		||||
      c /= 2;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (e + eBias >= eMax) {
 | 
			
		||||
      m = 0;
 | 
			
		||||
      e = eMax;
 | 
			
		||||
    } else if (e + eBias >= 1) {
 | 
			
		||||
      m = (value * c - 1) * Math.pow(2, mLen);
 | 
			
		||||
      e = e + eBias;
 | 
			
		||||
    } else {
 | 
			
		||||
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
 | 
			
		||||
      e = 0;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
 | 
			
		||||
 | 
			
		||||
  e = (e << mLen) | m;
 | 
			
		||||
  eLen += mLen;
 | 
			
		||||
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
 | 
			
		||||
 | 
			
		||||
  buffer[offset + i - d] |= s * 128;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										1317
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1317
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										14
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
Intro
 | 
			
		||||
=====
 | 
			
		||||
 | 
			
		||||
`base64-js` does basic base64 encoding/decoding in pure JS. Many browsers already have this functionality, but it is for text data, not all-purpose binary data.
 | 
			
		||||
 | 
			
		||||
Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
 | 
			
		||||
 | 
			
		||||
API
 | 
			
		||||
===
 | 
			
		||||
 | 
			
		||||
`base64-js` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument.
 | 
			
		||||
 | 
			
		||||
* toByteArray- Takes a base64 string and returns a byte array
 | 
			
		||||
* fromByteArray- Takes a byte array and returns a base64 string
 | 
			
		||||
							
								
								
									
										84
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
(function (exports) {
 | 
			
		||||
	'use strict';
 | 
			
		||||
 | 
			
		||||
	var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
 | 
			
		||||
 | 
			
		||||
	function b64ToByteArray(b64) {
 | 
			
		||||
		var i, j, l, tmp, placeHolders, arr;
 | 
			
		||||
	
 | 
			
		||||
		if (b64.length % 4 > 0) {
 | 
			
		||||
			throw 'Invalid string. Length must be a multiple of 4';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// the number of equal signs (place holders)
 | 
			
		||||
		// if there are two placeholders, than the two characters before it
 | 
			
		||||
		// represent one byte
 | 
			
		||||
		// if there is only one, then the three characters before it represent 2 bytes
 | 
			
		||||
		// this is just a cheap hack to not do indexOf twice
 | 
			
		||||
		placeHolders = b64.indexOf('=');
 | 
			
		||||
		placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0;
 | 
			
		||||
 | 
			
		||||
		// base64 is 4/3 + up to two characters of the original data
 | 
			
		||||
		arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders);
 | 
			
		||||
 | 
			
		||||
		// if there are placeholders, only get up to the last complete 4 chars
 | 
			
		||||
		l = placeHolders > 0 ? b64.length - 4 : b64.length;
 | 
			
		||||
 | 
			
		||||
		for (i = 0, j = 0; i < l; i += 4, j += 3) {
 | 
			
		||||
			tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]);
 | 
			
		||||
			arr.push((tmp & 0xFF0000) >> 16);
 | 
			
		||||
			arr.push((tmp & 0xFF00) >> 8);
 | 
			
		||||
			arr.push(tmp & 0xFF);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (placeHolders === 2) {
 | 
			
		||||
			tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4);
 | 
			
		||||
			arr.push(tmp & 0xFF);
 | 
			
		||||
		} else if (placeHolders === 1) {
 | 
			
		||||
			tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2);
 | 
			
		||||
			arr.push((tmp >> 8) & 0xFF);
 | 
			
		||||
			arr.push(tmp & 0xFF);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return arr;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	function uint8ToBase64(uint8) {
 | 
			
		||||
		var i,
 | 
			
		||||
			extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
 | 
			
		||||
			output = "",
 | 
			
		||||
			temp, length;
 | 
			
		||||
 | 
			
		||||
		function tripletToBase64 (num) {
 | 
			
		||||
			return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		// go through the array every three bytes, we'll deal with trailing stuff later
 | 
			
		||||
		for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
 | 
			
		||||
			temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
 | 
			
		||||
			output += tripletToBase64(temp);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// pad the end with zeros, but make sure to not forget the extra bytes
 | 
			
		||||
		switch (extraBytes) {
 | 
			
		||||
			case 1:
 | 
			
		||||
				temp = uint8[uint8.length - 1];
 | 
			
		||||
				output += lookup[temp >> 2];
 | 
			
		||||
				output += lookup[(temp << 4) & 0x3F];
 | 
			
		||||
				output += '==';
 | 
			
		||||
				break;
 | 
			
		||||
			case 2:
 | 
			
		||||
				temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]);
 | 
			
		||||
				output += lookup[temp >> 10];
 | 
			
		||||
				output += lookup[(temp >> 4) & 0x3F];
 | 
			
		||||
				output += lookup[(temp << 2) & 0x3F];
 | 
			
		||||
				output += '=';
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return output;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	module.exports.toByteArray = b64ToByteArray;
 | 
			
		||||
	module.exports.fromByteArray = uint8ToBase64;
 | 
			
		||||
}());
 | 
			
		||||
							
								
								
									
										25
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
{
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "T. Jameson Little",
 | 
			
		||||
    "email": "t.jameson.little@gmail.com"
 | 
			
		||||
  },
 | 
			
		||||
  "name": "base64-js",
 | 
			
		||||
  "description": "Base64 encoding/decoding in pure JS",
 | 
			
		||||
  "version": "0.0.2",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/beatgammit/deflate-js.git"
 | 
			
		||||
  },
 | 
			
		||||
  "main": "lib/b64.js",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "cd test; node runner.js; cd -"
 | 
			
		||||
  },
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "node": ">= 0.4"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {},
 | 
			
		||||
  "devDependencies": {},
 | 
			
		||||
  "readme": "Intro\n=====\n\n`base64-js` does basic base64 encoding/decoding in pure JS. Many browsers already have this functionality, but it is for text data, not all-purpose binary data.\n\nSometimes encoding/decoding binary data in the browser is useful, and that is what this module does.\n\nAPI\n===\n\n`base64-js` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument.\n\n* toByteArray- Takes a base64 string and returns a byte array\n* fromByteArray- Takes a byte array and returns a base64 string\n",
 | 
			
		||||
  "_id": "base64-js@0.0.2",
 | 
			
		||||
  "_from": "base64-js@0.0.2"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/test/runner.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/test/runner.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
(function () {
 | 
			
		||||
	'use strict';
 | 
			
		||||
 | 
			
		||||
	var b64 = require('../lib/b64'),
 | 
			
		||||
		checks = [
 | 
			
		||||
			'a',
 | 
			
		||||
			'aa',
 | 
			
		||||
			'aaa',
 | 
			
		||||
			'hi',
 | 
			
		||||
			'hi!',
 | 
			
		||||
			'hi!!',
 | 
			
		||||
			'sup',
 | 
			
		||||
			'sup?',
 | 
			
		||||
			'sup?!'
 | 
			
		||||
		],
 | 
			
		||||
		res;
 | 
			
		||||
 | 
			
		||||
	res = checks.some(function (check) {
 | 
			
		||||
		var b64Str,
 | 
			
		||||
			arr,
 | 
			
		||||
			arr2,
 | 
			
		||||
			str,
 | 
			
		||||
			i,
 | 
			
		||||
			l;
 | 
			
		||||
 | 
			
		||||
		arr2 = [];
 | 
			
		||||
		for (i = 0, l = check.length; i < l; i += 1) {
 | 
			
		||||
			arr2.push(check.charCodeAt(i));
 | 
			
		||||
		}
 | 
			
		||||
		b64Str = b64.fromByteArray(arr2);
 | 
			
		||||
 | 
			
		||||
		arr = b64.toByteArray(b64Str);
 | 
			
		||||
		arr2 = [];
 | 
			
		||||
		for (i = 0, l = arr.length; i < l; i += 1) {
 | 
			
		||||
			arr2.push(String.fromCharCode(arr[i]));
 | 
			
		||||
		}
 | 
			
		||||
		str = arr2.join('');
 | 
			
		||||
		if (check !== str) {
 | 
			
		||||
			console.log('Fail:', check);
 | 
			
		||||
			console.log('Base64:', b64Str);
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	if (res) {
 | 
			
		||||
		console.log('Test failed');
 | 
			
		||||
	} else {
 | 
			
		||||
		console.log('All tests passed!');
 | 
			
		||||
	}
 | 
			
		||||
}());
 | 
			
		||||
							
								
								
									
										41
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "buffer-browserify",
 | 
			
		||||
  "version": "0.0.5",
 | 
			
		||||
  "description": "buffer module compatibility for browserify",
 | 
			
		||||
  "main": "index.js",
 | 
			
		||||
  "browserify": "index.js",
 | 
			
		||||
  "directories": {
 | 
			
		||||
    "test": "test"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "base64-js": "0.0.2"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "tap": "0.2.x"
 | 
			
		||||
  },
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "http://github.com/toots/buffer-browserify.git"
 | 
			
		||||
  },
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "buffer",
 | 
			
		||||
    "browserify",
 | 
			
		||||
    "compatible",
 | 
			
		||||
    "meatless",
 | 
			
		||||
    "browser"
 | 
			
		||||
  ],
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Romain Beauxis",
 | 
			
		||||
    "email": "toots@rastageeks.org"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "node node_modules/tap/bin/tap.js test/*.js"
 | 
			
		||||
  },
 | 
			
		||||
  "license": "MIT/X11",
 | 
			
		||||
  "engine": {
 | 
			
		||||
    "node": ">=0.6"
 | 
			
		||||
  },
 | 
			
		||||
  "readme": "buffer-browserify\n===============\n\nThe buffer module from [node.js](http://nodejs.org/),\nbut for browsers.\n\nWhen you `require('buffer')` in\n[browserify](http://github.com/substack/node-browserify),\nthis module will be loaded.\n\nIt will also be loaded if you use the global `Buffer` variable.\n",
 | 
			
		||||
  "_id": "buffer-browserify@0.0.5",
 | 
			
		||||
  "_from": "buffer-browserify@~0.0.1"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										218
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/test/buffer.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										218
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/buffer-browserify/test/buffer.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,218 @@
 | 
			
		||||
var buffer = require('../index.js');
 | 
			
		||||
var test = require('tap').test;
 | 
			
		||||
 | 
			
		||||
test('utf8 buffer to base64', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("Ձאab", "utf8").toString("base64"),
 | 
			
		||||
        new Buffer("Ձאab", "utf8").toString("base64")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('utf8 buffer to hex', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("Ձאab", "utf8").toString("hex"),
 | 
			
		||||
        new Buffer("Ձאab", "utf8").toString("hex")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('utf8 to utf8', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("öäüõÖÄÜÕ", "utf8").toString("utf8"),
 | 
			
		||||
        new Buffer("öäüõÖÄÜÕ", "utf8").toString("utf8")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('ascii buffer to base64', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("123456!@#$%^", "ascii").toString("base64"),
 | 
			
		||||
        new Buffer("123456!@#$%^", "ascii").toString("base64")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('ascii buffer to hex', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("123456!@#$%^", "ascii").toString("hex"),
 | 
			
		||||
        new Buffer("123456!@#$%^", "ascii").toString("hex")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('base64 buffer to utf8', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("1YHXkGFi", "base64").toString("utf8"),
 | 
			
		||||
        new Buffer("1YHXkGFi", "base64").toString("utf8")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('hex buffer to utf8', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("d581d7906162", "hex").toString("utf8"),
 | 
			
		||||
        new Buffer("d581d7906162", "hex").toString("utf8")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('base64 buffer to ascii', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii"),
 | 
			
		||||
        new Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('hex buffer to ascii', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("31323334353621402324255e", "hex").toString("ascii"),
 | 
			
		||||
        new Buffer("31323334353621402324255e", "hex").toString("ascii")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
/*
 | 
			
		||||
test('utf8 to ascii', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("öäüõÖÄÜÕ", "utf8").toString("ascii"),
 | 
			
		||||
        new Buffer("öäüõÖÄÜÕ", "utf8").toString("ascii")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
test('base64 buffer to binary', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("MTIzNDU2IUAjJCVe", "base64").toString("binary"),
 | 
			
		||||
        new Buffer("MTIzNDU2IUAjJCVe", "base64").toString("binary")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('hex buffer to binary', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("31323334353621402324255e", "hex").toString("binary"),
 | 
			
		||||
        new Buffer("31323334353621402324255e", "hex").toString("binary")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('utf8 to binary', function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    t.equal(
 | 
			
		||||
        new buffer.Buffer("öäüõÖÄÜÕ", "utf8").toString("binary"),
 | 
			
		||||
        new Buffer("öäüõÖÄÜÕ", "utf8").toString("binary")
 | 
			
		||||
    );
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("hex of write{Uint,Int}{8,16,32}{LE,BE}", function (t) {
 | 
			
		||||
    t.plan(2*(2*2*2+2));
 | 
			
		||||
    ["UInt","Int"].forEach(function(x){
 | 
			
		||||
        [8,16,32].forEach(function(y){
 | 
			
		||||
            var endianesses = (y === 8) ? [""] : ["LE","BE"];
 | 
			
		||||
            endianesses.forEach(function(z){
 | 
			
		||||
                var v1  = new buffer.Buffer(y / 8);
 | 
			
		||||
                var v2  = new Buffer(y / 8);
 | 
			
		||||
                var writefn  = "write" + x + y + z;
 | 
			
		||||
                var val = (x === "Int") ? -3 : 3;
 | 
			
		||||
                v1[writefn](val, 0);
 | 
			
		||||
                v2[writefn](val, 0);
 | 
			
		||||
                t.equal(
 | 
			
		||||
                    v1.toString("hex"),
 | 
			
		||||
                    v2.toString("hex")
 | 
			
		||||
                );
 | 
			
		||||
                var readfn = "read" + x + y + z;
 | 
			
		||||
                t.equal(
 | 
			
		||||
                    v1[readfn](0),
 | 
			
		||||
                    v2[readfn](0)
 | 
			
		||||
                );
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("hex of write{Uint,Int}{8,16,32}{LE,BE} with overflow", function (t) {
 | 
			
		||||
    t.plan(3*(2*2*2+2));
 | 
			
		||||
    ["UInt","Int"].forEach(function(x){
 | 
			
		||||
        [8,16,32].forEach(function(y){
 | 
			
		||||
            var endianesses = (y === 8) ? [""] : ["LE","BE"];
 | 
			
		||||
            endianesses.forEach(function(z){
 | 
			
		||||
                var v1  = new buffer.Buffer(y / 8 - 1);
 | 
			
		||||
                var v2  = new Buffer(y / 8 - 1);
 | 
			
		||||
                var next = new buffer.Buffer(4);
 | 
			
		||||
                next.writeUInt32BE(0, 0);
 | 
			
		||||
                var writefn  = "write" + x + y + z;
 | 
			
		||||
                var val = (x === "Int") ? -3 : 3;
 | 
			
		||||
                v1[writefn](val, 0, true);
 | 
			
		||||
                v2[writefn](val, 0, true);
 | 
			
		||||
                t.equal(
 | 
			
		||||
                    v1.toString("hex"),
 | 
			
		||||
                    v2.toString("hex")
 | 
			
		||||
                );
 | 
			
		||||
                // check that nothing leaked to next buffer.
 | 
			
		||||
                t.equal(next.readUInt32BE(0), 0);
 | 
			
		||||
                // check that no bytes are read from next buffer.
 | 
			
		||||
                next.writeInt32BE(~0, 0);
 | 
			
		||||
                var readfn = "read" + x + y + z;
 | 
			
		||||
                t.equal(
 | 
			
		||||
                    v1[readfn](0, true),
 | 
			
		||||
                    v2[readfn](0, true)
 | 
			
		||||
                );
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("concat() a varying number of buffers", function (t) {
 | 
			
		||||
    t.plan(5);
 | 
			
		||||
    var zero = [];
 | 
			
		||||
    var one  = [ new buffer.Buffer('asdf') ];
 | 
			
		||||
    var long = [];
 | 
			
		||||
    for (var i = 0; i < 10; i++) long.push(new buffer.Buffer('asdf'));
 | 
			
		||||
 | 
			
		||||
    var flatZero = buffer.Buffer.concat(zero);
 | 
			
		||||
    var flatOne = buffer.Buffer.concat(one);
 | 
			
		||||
    var flatLong = buffer.Buffer.concat(long);
 | 
			
		||||
    var flatLongLen = buffer.Buffer.concat(long, 40);
 | 
			
		||||
 | 
			
		||||
    t.equal(flatZero.length, 0);
 | 
			
		||||
    t.equal(flatOne.toString(), 'asdf');
 | 
			
		||||
    t.equal(flatOne, one[0]);
 | 
			
		||||
    t.equal(flatLong.toString(), (new Array(10+1).join('asdf')));
 | 
			
		||||
    t.equal(flatLongLen.toString(), (new Array(10+1).join('asdf')));
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("buffer from buffer", function (t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    var b1 = new buffer.Buffer('asdf');
 | 
			
		||||
    var b2 = new buffer.Buffer(b1);
 | 
			
		||||
    t.equal(b1.toString('hex'), b2.toString('hex'));
 | 
			
		||||
    t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("fill", function(t) {
 | 
			
		||||
    t.plan(1);
 | 
			
		||||
    var b1 = new Buffer(10);
 | 
			
		||||
    var b2 = new buffer.Buffer(10);
 | 
			
		||||
    b1.fill(2);
 | 
			
		||||
    b2.fill(2);
 | 
			
		||||
    t.equal(b1.toString('hex'), b2.toString('hex'));
 | 
			
		||||
    t.end();
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
*.coffee
 | 
			
		||||
*.html
 | 
			
		||||
.DS_Store
 | 
			
		||||
.git*
 | 
			
		||||
Cakefile
 | 
			
		||||
documentation/
 | 
			
		||||
examples/
 | 
			
		||||
extras/coffee-script.js
 | 
			
		||||
raw/
 | 
			
		||||
src/
 | 
			
		||||
test/
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/CNAME
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/CNAME
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
coffeescript.org
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/CONTRIBUTING.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/CONTRIBUTING.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
## How to contribute to CoffeeScript
 | 
			
		||||
 | 
			
		||||
* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffee-script/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/coffee-script/tree/master/test).
 | 
			
		||||
 | 
			
		||||
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffee-script/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.
 | 
			
		||||
							
								
								
									
										22
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
Copyright (c) 2009-2013 Jeremy Ashkenas
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
							
								
								
									
										51
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/README
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/README
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
 | 
			
		||||
            {
 | 
			
		||||
         }   }   {
 | 
			
		||||
        {   {  }  }
 | 
			
		||||
         }   }{  {
 | 
			
		||||
        {  }{  }  }                    _____       __  __
 | 
			
		||||
       ( }{ }{  { )                   / ____|     / _|/ _|
 | 
			
		||||
     .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
 | 
			
		||||
    (  ( } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
 | 
			
		||||
    |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
 | 
			
		||||
    |                 |               \_____\___/|_| |_| \___|\___|
 | 
			
		||||
    |                 ;--.
 | 
			
		||||
    |                (__  \            _____           _       _
 | 
			
		||||
    |                 | )  )          / ____|         (_)     | |
 | 
			
		||||
    |                 |/  /          | (___   ___ _ __ _ _ __ | |_
 | 
			
		||||
    |                 (  /            \___ \ / __| '__| | '_ \| __|
 | 
			
		||||
    |                 |/              ____) | (__| |  | | |_) | |_
 | 
			
		||||
    |                 |              |_____/ \___|_|  |_| .__/ \__|
 | 
			
		||||
     `-.._________..-'                                  | |
 | 
			
		||||
                                                        |_|
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  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:
 | 
			
		||||
  npm install -g coffee-script
 | 
			
		||||
  (Leave off the -g if you don't wish to install globally.)
 | 
			
		||||
 | 
			
		||||
  Execute a script:
 | 
			
		||||
  coffee /path/to/script.coffee
 | 
			
		||||
 | 
			
		||||
  Compile a script:
 | 
			
		||||
  coffee -c /path/to/script.coffee
 | 
			
		||||
 | 
			
		||||
  For documentation, usage, and examples, see:
 | 
			
		||||
  http://coffeescript.org/
 | 
			
		||||
 | 
			
		||||
  To suggest a feature, report a bug, or general discussion:
 | 
			
		||||
  http://github.com/jashkenas/coffee-script/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
 | 
			
		||||
 | 
			
		||||
  All contributors are listed here:
 | 
			
		||||
  http://github.com/jashkenas/coffee-script/contributors
 | 
			
		||||
							
								
								
									
										79
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/Rakefile
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/Rakefile
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,79 @@
 | 
			
		||||
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'
 | 
			
		||||
    s.license           = "MIT"
 | 
			
		||||
  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
 | 
			
		||||
							
								
								
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/bin/cake
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/bin/cake
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var fs   = require('fs');
 | 
			
		||||
var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
 | 
			
		||||
 | 
			
		||||
require(lib + '/coffee-script/cake').run();
 | 
			
		||||
							
								
								
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/bin/coffee
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/bin/coffee
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
#!/usr/bin/env node
 | 
			
		||||
 | 
			
		||||
var path = require('path');
 | 
			
		||||
var fs   = require('fs');
 | 
			
		||||
var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
 | 
			
		||||
 | 
			
		||||
require(lib + '/coffee-script/command').run();
 | 
			
		||||
							
								
								
									
										44
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/extras/jsl.conf
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/extras/jsl.conf
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
# 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
 | 
			
		||||
							
								
								
									
										125
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,125 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  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) {
 | 
			
		||||
      options.bare = true;
 | 
			
		||||
    }
 | 
			
		||||
    return eval(compile(code, options));
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  CoffeeScript.run = function(code, options) {
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    options.bare = true;
 | 
			
		||||
    return Function(compile(code, options))();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if (typeof window === "undefined" || window === null) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== 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(v3SourceMap)) + "\n//@ sourceURL=coffeescript";
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  CoffeeScript.load = function(url, callback, options) {
 | 
			
		||||
    var xhr;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    options.sourceFiles = [url];
 | 
			
		||||
    xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
 | 
			
		||||
    xhr.open('GET', url, true);
 | 
			
		||||
    if ('overrideMimeType' in xhr) {
 | 
			
		||||
      xhr.overrideMimeType('text/plain');
 | 
			
		||||
    }
 | 
			
		||||
    xhr.onreadystatechange = function() {
 | 
			
		||||
      var _ref;
 | 
			
		||||
 | 
			
		||||
      if (xhr.readyState === 4) {
 | 
			
		||||
        if ((_ref = xhr.status) === 0 || _ref === 200) {
 | 
			
		||||
          CoffeeScript.run(xhr.responseText, options);
 | 
			
		||||
        } else {
 | 
			
		||||
          throw new Error("Could not load " + url);
 | 
			
		||||
        }
 | 
			
		||||
        if (callback) {
 | 
			
		||||
          return callback();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
    return xhr.send(null);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  runScripts = function() {
 | 
			
		||||
    var coffees, coffeetypes, execute, index, length, s, scripts;
 | 
			
		||||
 | 
			
		||||
    scripts = document.getElementsByTagName('script');
 | 
			
		||||
    coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
 | 
			
		||||
    coffees = (function() {
 | 
			
		||||
      var _i, _len, _ref, _results;
 | 
			
		||||
 | 
			
		||||
      _results = [];
 | 
			
		||||
      for (_i = 0, _len = scripts.length; _i < _len; _i++) {
 | 
			
		||||
        s = scripts[_i];
 | 
			
		||||
        if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
 | 
			
		||||
          _results.push(s);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    })();
 | 
			
		||||
    index = 0;
 | 
			
		||||
    length = coffees.length;
 | 
			
		||||
    (execute = function() {
 | 
			
		||||
      var mediatype, options, script;
 | 
			
		||||
 | 
			
		||||
      script = coffees[index++];
 | 
			
		||||
      mediatype = script != null ? script.type : void 0;
 | 
			
		||||
      if (__indexOf.call(coffeetypes, mediatype) >= 0) {
 | 
			
		||||
        options = {
 | 
			
		||||
          literate: mediatype === 'text/literate-coffeescript'
 | 
			
		||||
        };
 | 
			
		||||
        if (script.src) {
 | 
			
		||||
          return CoffeeScript.load(script.src, execute, options);
 | 
			
		||||
        } else {
 | 
			
		||||
          options.sourceFiles = ['embedded'];
 | 
			
		||||
          CoffeeScript.run(script.innerHTML, options);
 | 
			
		||||
          return execute();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    })();
 | 
			
		||||
    return null;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if (window.addEventListener) {
 | 
			
		||||
    addEventListener('DOMContentLoaded', runScripts, false);
 | 
			
		||||
  } else {
 | 
			
		||||
    attachEvent('onload', runScripts);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										118
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/cake.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/cake.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,118 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
 | 
			
		||||
 | 
			
		||||
  fs = require('fs');
 | 
			
		||||
 | 
			
		||||
  path = require('path');
 | 
			
		||||
 | 
			
		||||
  helpers = require('./helpers');
 | 
			
		||||
 | 
			
		||||
  optparse = require('./optparse');
 | 
			
		||||
 | 
			
		||||
  CoffeeScript = require('./coffee-script');
 | 
			
		||||
 | 
			
		||||
  existsSync = fs.existsSync || path.existsSync;
 | 
			
		||||
 | 
			
		||||
  tasks = {};
 | 
			
		||||
 | 
			
		||||
  options = {};
 | 
			
		||||
 | 
			
		||||
  switches = [];
 | 
			
		||||
 | 
			
		||||
  oparse = null;
 | 
			
		||||
 | 
			
		||||
  helpers.extend(global, {
 | 
			
		||||
    task: function(name, description, action) {
 | 
			
		||||
      var _ref;
 | 
			
		||||
 | 
			
		||||
      if (!action) {
 | 
			
		||||
        _ref = [description, action], action = _ref[0], description = _ref[1];
 | 
			
		||||
      }
 | 
			
		||||
      return tasks[name] = {
 | 
			
		||||
        name: name,
 | 
			
		||||
        description: description,
 | 
			
		||||
        action: action
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
    option: function(letter, flag, description) {
 | 
			
		||||
      return switches.push([letter, flag, description]);
 | 
			
		||||
    },
 | 
			
		||||
    invoke: function(name) {
 | 
			
		||||
      if (!tasks[name]) {
 | 
			
		||||
        missingTask(name);
 | 
			
		||||
      }
 | 
			
		||||
      return tasks[name].action(options);
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  exports.run = function() {
 | 
			
		||||
    var arg, args, e, _i, _len, _ref, _results;
 | 
			
		||||
 | 
			
		||||
    global.__originalDirname = fs.realpathSync('.');
 | 
			
		||||
    process.chdir(cakefileDirectory(__originalDirname));
 | 
			
		||||
    args = process.argv.slice(2);
 | 
			
		||||
    CoffeeScript.run(fs.readFileSync('Cakefile').toString(), {
 | 
			
		||||
      filename: 'Cakefile'
 | 
			
		||||
    });
 | 
			
		||||
    oparse = new optparse.OptionParser(switches);
 | 
			
		||||
    if (!args.length) {
 | 
			
		||||
      return printTasks();
 | 
			
		||||
    }
 | 
			
		||||
    try {
 | 
			
		||||
      options = oparse.parse(args);
 | 
			
		||||
    } catch (_error) {
 | 
			
		||||
      e = _error;
 | 
			
		||||
      return fatalError("" + e);
 | 
			
		||||
    }
 | 
			
		||||
    _ref = options["arguments"];
 | 
			
		||||
    _results = [];
 | 
			
		||||
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
 | 
			
		||||
      arg = _ref[_i];
 | 
			
		||||
      _results.push(invoke(arg));
 | 
			
		||||
    }
 | 
			
		||||
    return _results;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  printTasks = function() {
 | 
			
		||||
    var cakefilePath, desc, name, relative, spaces, task;
 | 
			
		||||
 | 
			
		||||
    relative = path.relative || path.resolve;
 | 
			
		||||
    cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
 | 
			
		||||
    console.log("" + cakefilePath + " defines the following tasks:\n");
 | 
			
		||||
    for (name in tasks) {
 | 
			
		||||
      task = tasks[name];
 | 
			
		||||
      spaces = 20 - name.length;
 | 
			
		||||
      spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
 | 
			
		||||
      desc = task.description ? "# " + task.description : '';
 | 
			
		||||
      console.log("cake " + name + spaces + " " + desc);
 | 
			
		||||
    }
 | 
			
		||||
    if (switches.length) {
 | 
			
		||||
      return console.log(oparse.help());
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  fatalError = function(message) {
 | 
			
		||||
    console.error(message + '\n');
 | 
			
		||||
    console.log('To see a list of all tasks/options, run "cake"');
 | 
			
		||||
    return process.exit(1);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  missingTask = function(task) {
 | 
			
		||||
    return fatalError("No such task: " + task);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  cakefileDirectory = function(dir) {
 | 
			
		||||
    var parent;
 | 
			
		||||
 | 
			
		||||
    if (existsSync(path.join(dir, 'Cakefile'))) {
 | 
			
		||||
      return dir;
 | 
			
		||||
    }
 | 
			
		||||
    parent = path.normalize(path.join(dir, '..'));
 | 
			
		||||
    if (parent !== dir) {
 | 
			
		||||
      return cakefileDirectory(parent);
 | 
			
		||||
    }
 | 
			
		||||
    throw new Error("Cakefile not found in " + (process.cwd()));
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										342
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/coffee-script.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										342
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/coffee-script.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,342 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var Lexer, child_process, compile, ext, fork, formatSourcePosition, fs, helpers, lexer, loadFile, parser, patchStackTrace, patched, path, sourcemap, vm, _i, _len, _ref,
 | 
			
		||||
    __hasProp = {}.hasOwnProperty;
 | 
			
		||||
 | 
			
		||||
  fs = require('fs');
 | 
			
		||||
 | 
			
		||||
  vm = require('vm');
 | 
			
		||||
 | 
			
		||||
  path = require('path');
 | 
			
		||||
 | 
			
		||||
  child_process = require('child_process');
 | 
			
		||||
 | 
			
		||||
  Lexer = require('./lexer').Lexer;
 | 
			
		||||
 | 
			
		||||
  parser = require('./parser').parser;
 | 
			
		||||
 | 
			
		||||
  helpers = require('./helpers');
 | 
			
		||||
 | 
			
		||||
  sourcemap = require('./sourcemap');
 | 
			
		||||
 | 
			
		||||
  exports.VERSION = '1.6.2';
 | 
			
		||||
 | 
			
		||||
  exports.helpers = helpers;
 | 
			
		||||
 | 
			
		||||
  exports.compile = compile = function(code, options) {
 | 
			
		||||
    var answer, currentColumn, currentLine, fragment, fragments, header, js, merge, newLines, sourceMap, _i, _len;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    merge = exports.helpers.merge;
 | 
			
		||||
    if (options.sourceMap) {
 | 
			
		||||
      sourceMap = new sourcemap.SourceMap();
 | 
			
		||||
    }
 | 
			
		||||
    fragments = (parser.parse(lexer.tokenize(code, options))).compileToFragments(options);
 | 
			
		||||
    currentLine = 0;
 | 
			
		||||
    if (options.header || options.inline) {
 | 
			
		||||
      currentLine += 1;
 | 
			
		||||
    }
 | 
			
		||||
    currentColumn = 0;
 | 
			
		||||
    js = "";
 | 
			
		||||
    for (_i = 0, _len = fragments.length; _i < _len; _i++) {
 | 
			
		||||
      fragment = fragments[_i];
 | 
			
		||||
      if (sourceMap) {
 | 
			
		||||
        if (fragment.locationData) {
 | 
			
		||||
          sourceMap.addMapping([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
 | 
			
		||||
            noReplace: true
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
        newLines = helpers.count(fragment.code, "\n");
 | 
			
		||||
        currentLine += newLines;
 | 
			
		||||
        currentColumn = fragment.code.length - (newLines ? fragment.code.lastIndexOf("\n") : 0);
 | 
			
		||||
      }
 | 
			
		||||
      js += fragment.code;
 | 
			
		||||
    }
 | 
			
		||||
    if (options.header) {
 | 
			
		||||
      header = "Generated by CoffeeScript " + this.VERSION;
 | 
			
		||||
      js = "// " + header + "\n" + js;
 | 
			
		||||
    }
 | 
			
		||||
    if (options.sourceMap) {
 | 
			
		||||
      answer = {
 | 
			
		||||
        js: js
 | 
			
		||||
      };
 | 
			
		||||
      if (sourceMap) {
 | 
			
		||||
        answer.sourceMap = sourceMap;
 | 
			
		||||
        answer.v3SourceMap = sourcemap.generateV3SourceMap(sourceMap, options, code);
 | 
			
		||||
      }
 | 
			
		||||
      return answer;
 | 
			
		||||
    } else {
 | 
			
		||||
      return js;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.tokens = function(code, options) {
 | 
			
		||||
    return lexer.tokenize(code, options);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.nodes = 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 answer, mainModule, _ref;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    mainModule = require.main;
 | 
			
		||||
    if ((_ref = options.sourceMap) == null) {
 | 
			
		||||
      options.sourceMap = true;
 | 
			
		||||
    }
 | 
			
		||||
    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 (!helpers.isCoffee(mainModule.filename) || require.extensions) {
 | 
			
		||||
      answer = compile(code, options);
 | 
			
		||||
      patchStackTrace();
 | 
			
		||||
      mainModule._sourceMaps[mainModule.filename] = answer.sourceMap;
 | 
			
		||||
      return mainModule._compile(answer.js, mainModule.filename);
 | 
			
		||||
    } else {
 | 
			
		||||
      return mainModule._compile(code, mainModule.filename);
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports["eval"] = function(code, options) {
 | 
			
		||||
    var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    if (!(code = code.trim())) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    Script = vm.Script;
 | 
			
		||||
    if (Script) {
 | 
			
		||||
      if (options.sandbox != null) {
 | 
			
		||||
        if (options.sandbox instanceof Script.createContext().constructor) {
 | 
			
		||||
          sandbox = options.sandbox;
 | 
			
		||||
        } else {
 | 
			
		||||
          sandbox = Script.createContext();
 | 
			
		||||
          _ref = options.sandbox;
 | 
			
		||||
          for (k in _ref) {
 | 
			
		||||
            if (!__hasProp.call(_ref, k)) continue;
 | 
			
		||||
            v = _ref[k];
 | 
			
		||||
            sandbox[k] = v;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
 | 
			
		||||
      } else {
 | 
			
		||||
        sandbox = global;
 | 
			
		||||
      }
 | 
			
		||||
      sandbox.__filename = options.filename || 'eval';
 | 
			
		||||
      sandbox.__dirname = path.dirname(sandbox.__filename);
 | 
			
		||||
      if (!(sandbox !== global || sandbox.module || sandbox.require)) {
 | 
			
		||||
        Module = require('module');
 | 
			
		||||
        sandbox.module = _module = new Module(options.modulename || 'eval');
 | 
			
		||||
        sandbox.require = _require = function(path) {
 | 
			
		||||
          return Module._load(path, _module, true);
 | 
			
		||||
        };
 | 
			
		||||
        _module.filename = sandbox.__filename;
 | 
			
		||||
        _ref1 = Object.getOwnPropertyNames(require);
 | 
			
		||||
        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
 | 
			
		||||
          r = _ref1[_i];
 | 
			
		||||
          if (r !== 'paths') {
 | 
			
		||||
            _require[r] = require[r];
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        _require.paths = _module.paths = Module._nodeModulePaths(process.cwd());
 | 
			
		||||
        _require.resolve = function(request) {
 | 
			
		||||
          return Module._resolveFilename(request, _module);
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    o = {};
 | 
			
		||||
    for (k in options) {
 | 
			
		||||
      if (!__hasProp.call(options, k)) continue;
 | 
			
		||||
      v = options[k];
 | 
			
		||||
      o[k] = v;
 | 
			
		||||
    }
 | 
			
		||||
    o.bare = true;
 | 
			
		||||
    js = compile(code, o);
 | 
			
		||||
    if (sandbox === global) {
 | 
			
		||||
      return vm.runInThisContext(js);
 | 
			
		||||
    } else {
 | 
			
		||||
      return vm.runInContext(js, sandbox);
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  loadFile = function(module, filename) {
 | 
			
		||||
    var raw, stripped;
 | 
			
		||||
 | 
			
		||||
    raw = fs.readFileSync(filename, 'utf8');
 | 
			
		||||
    stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
 | 
			
		||||
    return module._compile(compile(stripped, {
 | 
			
		||||
      filename: filename,
 | 
			
		||||
      literate: helpers.isLiterate(filename)
 | 
			
		||||
    }), filename);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if (require.extensions) {
 | 
			
		||||
    _ref = ['.coffee', '.litcoffee', '.coffee.md'];
 | 
			
		||||
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
 | 
			
		||||
      ext = _ref[_i];
 | 
			
		||||
      require.extensions[ext] = loadFile;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (child_process) {
 | 
			
		||||
    fork = child_process.fork;
 | 
			
		||||
    child_process.fork = function(path, args, options) {
 | 
			
		||||
      var execPath;
 | 
			
		||||
 | 
			
		||||
      if (args == null) {
 | 
			
		||||
        args = [];
 | 
			
		||||
      }
 | 
			
		||||
      if (options == null) {
 | 
			
		||||
        options = {};
 | 
			
		||||
      }
 | 
			
		||||
      execPath = helpers.isCoffee(path) ? 'coffee' : null;
 | 
			
		||||
      if (!Array.isArray(args)) {
 | 
			
		||||
        args = [];
 | 
			
		||||
        options = args || {};
 | 
			
		||||
      }
 | 
			
		||||
      options.execPath || (options.execPath = execPath);
 | 
			
		||||
      return fork(path, args, options);
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  lexer = new Lexer;
 | 
			
		||||
 | 
			
		||||
  parser.lexer = {
 | 
			
		||||
    lex: function() {
 | 
			
		||||
      var tag, token;
 | 
			
		||||
 | 
			
		||||
      token = this.tokens[this.pos++];
 | 
			
		||||
      if (token) {
 | 
			
		||||
        tag = token[0], this.yytext = token[1], this.yylloc = token[2];
 | 
			
		||||
        this.yylineno = this.yylloc.first_line;
 | 
			
		||||
      } else {
 | 
			
		||||
        tag = '';
 | 
			
		||||
      }
 | 
			
		||||
      return tag;
 | 
			
		||||
    },
 | 
			
		||||
    setInput: function(tokens) {
 | 
			
		||||
      this.tokens = tokens;
 | 
			
		||||
      return this.pos = 0;
 | 
			
		||||
    },
 | 
			
		||||
    upcomingInput: function() {
 | 
			
		||||
      return "";
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  parser.yy = require('./nodes');
 | 
			
		||||
 | 
			
		||||
  parser.yy.parseError = function(message, _arg) {
 | 
			
		||||
    var token;
 | 
			
		||||
 | 
			
		||||
    token = _arg.token;
 | 
			
		||||
    message = "unexpected " + (token === 1 ? 'end of input' : token);
 | 
			
		||||
    return helpers.throwSyntaxError(message, parser.lexer.yylloc);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  patched = false;
 | 
			
		||||
 | 
			
		||||
  patchStackTrace = function() {
 | 
			
		||||
    var mainModule;
 | 
			
		||||
 | 
			
		||||
    if (patched) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    patched = true;
 | 
			
		||||
    mainModule = require.main;
 | 
			
		||||
    mainModule._sourceMaps = {};
 | 
			
		||||
    return Error.prepareStackTrace = function(err, stack) {
 | 
			
		||||
      var frame, frames, getSourceMapping, sourceFiles, _ref1;
 | 
			
		||||
 | 
			
		||||
      sourceFiles = {};
 | 
			
		||||
      getSourceMapping = function(filename, line, column) {
 | 
			
		||||
        var answer, sourceMap;
 | 
			
		||||
 | 
			
		||||
        sourceMap = mainModule._sourceMaps[filename];
 | 
			
		||||
        if (sourceMap) {
 | 
			
		||||
          answer = sourceMap.getSourcePosition([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.name + ": " + ((_ref1 = err.message) != null ? _ref1 : '') + "\n" + (frames.join('\n')) + "\n";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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] + ", <js>:" + line + ":" + column : "" + 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;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										558
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/command.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										558
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/command.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,558 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, lint, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref;
 | 
			
		||||
 | 
			
		||||
  fs = require('fs');
 | 
			
		||||
 | 
			
		||||
  path = require('path');
 | 
			
		||||
 | 
			
		||||
  helpers = require('./helpers');
 | 
			
		||||
 | 
			
		||||
  optparse = require('./optparse');
 | 
			
		||||
 | 
			
		||||
  CoffeeScript = require('./coffee-script');
 | 
			
		||||
 | 
			
		||||
  _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
 | 
			
		||||
 | 
			
		||||
  EventEmitter = require('events').EventEmitter;
 | 
			
		||||
 | 
			
		||||
  exists = fs.exists || path.exists;
 | 
			
		||||
 | 
			
		||||
  helpers.extend(CoffeeScript, new EventEmitter);
 | 
			
		||||
 | 
			
		||||
  printLine = function(line) {
 | 
			
		||||
    return process.stdout.write(line + '\n');
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  printWarn = function(line) {
 | 
			
		||||
    return process.stderr.write(line + '\n');
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  hidden = function(file) {
 | 
			
		||||
    return /^\.|~$/.test(file);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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'], ['-m', '--map', 'generate source map and save as .map files'], ['-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'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
 | 
			
		||||
 | 
			
		||||
  opts = {};
 | 
			
		||||
 | 
			
		||||
  sources = [];
 | 
			
		||||
 | 
			
		||||
  sourceCode = [];
 | 
			
		||||
 | 
			
		||||
  notSources = {};
 | 
			
		||||
 | 
			
		||||
  watchers = {};
 | 
			
		||||
 | 
			
		||||
  optionParser = null;
 | 
			
		||||
 | 
			
		||||
  exports.run = function() {
 | 
			
		||||
    var literals, source, _i, _len, _results;
 | 
			
		||||
 | 
			
		||||
    parseOptions();
 | 
			
		||||
    if (opts.nodejs) {
 | 
			
		||||
      return forkNode();
 | 
			
		||||
    }
 | 
			
		||||
    if (opts.help) {
 | 
			
		||||
      return usage();
 | 
			
		||||
    }
 | 
			
		||||
    if (opts.version) {
 | 
			
		||||
      return version();
 | 
			
		||||
    }
 | 
			
		||||
    if (opts.interactive) {
 | 
			
		||||
      return require('./repl').start();
 | 
			
		||||
    }
 | 
			
		||||
    if (opts.watch && !fs.watch) {
 | 
			
		||||
      return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + ".");
 | 
			
		||||
    }
 | 
			
		||||
    if (opts.stdio) {
 | 
			
		||||
      return compileStdio();
 | 
			
		||||
    }
 | 
			
		||||
    if (opts["eval"]) {
 | 
			
		||||
      return compileScript(null, sources[0]);
 | 
			
		||||
    }
 | 
			
		||||
    if (!sources.length) {
 | 
			
		||||
      return require('./repl').start();
 | 
			
		||||
    }
 | 
			
		||||
    literals = opts.run ? sources.splice(1) : [];
 | 
			
		||||
    process.argv = process.argv.slice(0, 2).concat(literals);
 | 
			
		||||
    process.argv[0] = 'coffee';
 | 
			
		||||
    _results = [];
 | 
			
		||||
    for (_i = 0, _len = sources.length; _i < _len; _i++) {
 | 
			
		||||
      source = sources[_i];
 | 
			
		||||
      _results.push(compilePath(source, true, path.normalize(source)));
 | 
			
		||||
    }
 | 
			
		||||
    return _results;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  compilePath = function(source, topLevel, base) {
 | 
			
		||||
    return fs.stat(source, function(err, stats) {
 | 
			
		||||
      if (err && err.code !== 'ENOENT') {
 | 
			
		||||
        throw err;
 | 
			
		||||
      }
 | 
			
		||||
      if ((err != null ? err.code : void 0) === 'ENOENT') {
 | 
			
		||||
        console.error("File not found: " + source);
 | 
			
		||||
        process.exit(1);
 | 
			
		||||
      }
 | 
			
		||||
      if (stats.isDirectory() && path.dirname(source) !== 'node_modules') {
 | 
			
		||||
        if (opts.watch) {
 | 
			
		||||
          watchDir(source, base);
 | 
			
		||||
        }
 | 
			
		||||
        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 || helpers.isCoffee(source)) {
 | 
			
		||||
        if (opts.watch) {
 | 
			
		||||
          watch(source, base);
 | 
			
		||||
        }
 | 
			
		||||
        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);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  compileScript = function(file, input, base) {
 | 
			
		||||
    var compiled, err, message, o, options, t, task, useColors;
 | 
			
		||||
 | 
			
		||||
    if (base == null) {
 | 
			
		||||
      base = null;
 | 
			
		||||
    }
 | 
			
		||||
    o = opts;
 | 
			
		||||
    options = compileOptions(file, base);
 | 
			
		||||
    try {
 | 
			
		||||
      t = task = {
 | 
			
		||||
        file: file,
 | 
			
		||||
        input: input,
 | 
			
		||||
        options: options
 | 
			
		||||
      };
 | 
			
		||||
      CoffeeScript.emit('compile', task);
 | 
			
		||||
      if (o.tokens) {
 | 
			
		||||
        return printTokens(CoffeeScript.tokens(t.input, t.options));
 | 
			
		||||
      } else if (o.nodes) {
 | 
			
		||||
        return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim());
 | 
			
		||||
      } else if (o.run) {
 | 
			
		||||
        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 {
 | 
			
		||||
        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 || o.map) {
 | 
			
		||||
          return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap);
 | 
			
		||||
        } else if (o.lint) {
 | 
			
		||||
          return lint(t.file, t.output);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    } catch (_error) {
 | 
			
		||||
      err = _error;
 | 
			
		||||
      CoffeeScript.emit('failure', err, task);
 | 
			
		||||
      if (CoffeeScript.listeners('failure').length) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      useColors = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS;
 | 
			
		||||
      message = helpers.prettyErrorMessage(err, file || '[stdin]', input, useColors);
 | 
			
		||||
      if (o.watch) {
 | 
			
		||||
        return printLine(message + '\x07');
 | 
			
		||||
      } else {
 | 
			
		||||
        printWarn(message);
 | 
			
		||||
        return process.exit(1);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  compileStdio = function() {
 | 
			
		||||
    var code, stdin;
 | 
			
		||||
 | 
			
		||||
    code = '';
 | 
			
		||||
    stdin = process.openStdin();
 | 
			
		||||
    stdin.on('data', function(buffer) {
 | 
			
		||||
      if (buffer) {
 | 
			
		||||
        return code += buffer.toString();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    return stdin.on('end', function() {
 | 
			
		||||
      return compileScript(null, code);
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  joinTimeout = null;
 | 
			
		||||
 | 
			
		||||
  compileJoin = function() {
 | 
			
		||||
    if (!opts.join) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    if (!sourceCode.some(function(code) {
 | 
			
		||||
      return code === null;
 | 
			
		||||
    })) {
 | 
			
		||||
      clearTimeout(joinTimeout);
 | 
			
		||||
      return joinTimeout = wait(100, function() {
 | 
			
		||||
        return compileScript(opts.join, sourceCode.join('\n'), opts.join);
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  watch = function(source, base) {
 | 
			
		||||
    var compile, compileTimeout, e, prevStats, rewatch, watchErr, watcher;
 | 
			
		||||
 | 
			
		||||
    prevStats = null;
 | 
			
		||||
    compileTimeout = null;
 | 
			
		||||
    watchErr = function(e) {
 | 
			
		||||
      if (e.code === 'ENOENT') {
 | 
			
		||||
        if (sources.indexOf(source) === -1) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        try {
 | 
			
		||||
          rewatch();
 | 
			
		||||
          return compile();
 | 
			
		||||
        } catch (_error) {
 | 
			
		||||
          e = _error;
 | 
			
		||||
          removeSource(source, base, true);
 | 
			
		||||
          return compileJoin();
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        throw e;
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
    compile = function() {
 | 
			
		||||
      clearTimeout(compileTimeout);
 | 
			
		||||
      return compileTimeout = wait(25, function() {
 | 
			
		||||
        return fs.stat(source, function(err, stats) {
 | 
			
		||||
          if (err) {
 | 
			
		||||
            return watchErr(err);
 | 
			
		||||
          }
 | 
			
		||||
          if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) {
 | 
			
		||||
            return rewatch();
 | 
			
		||||
          }
 | 
			
		||||
          prevStats = stats;
 | 
			
		||||
          return fs.readFile(source, function(err, code) {
 | 
			
		||||
            if (err) {
 | 
			
		||||
              return watchErr(err);
 | 
			
		||||
            }
 | 
			
		||||
            compileScript(source, code.toString(), base);
 | 
			
		||||
            return rewatch();
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
    try {
 | 
			
		||||
      watcher = fs.watch(source, compile);
 | 
			
		||||
    } catch (_error) {
 | 
			
		||||
      e = _error;
 | 
			
		||||
      watchErr(e);
 | 
			
		||||
    }
 | 
			
		||||
    return rewatch = function() {
 | 
			
		||||
      if (watcher != null) {
 | 
			
		||||
        watcher.close();
 | 
			
		||||
      }
 | 
			
		||||
      return watcher = fs.watch(source, compile);
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  watchDir = function(source, base) {
 | 
			
		||||
    var e, readdirTimeout, watcher;
 | 
			
		||||
 | 
			
		||||
    readdirTimeout = null;
 | 
			
		||||
    try {
 | 
			
		||||
      return watcher = fs.watch(source, 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));
 | 
			
		||||
            }
 | 
			
		||||
            return _results;
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    } catch (_error) {
 | 
			
		||||
      e = _error;
 | 
			
		||||
      if (e.code !== 'ENOENT') {
 | 
			
		||||
        throw e;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    })();
 | 
			
		||||
    for (_i = 0, _len = toRemove.length; _i < _len; _i++) {
 | 
			
		||||
      file = toRemove[_i];
 | 
			
		||||
      removeSource(file, base, true);
 | 
			
		||||
    }
 | 
			
		||||
    if (!sources.some(function(s, i) {
 | 
			
		||||
      return prevSources[i] !== s;
 | 
			
		||||
    })) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    return compileJoin();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  removeSource = function(source, base, removeJs) {
 | 
			
		||||
    var index, jsPath;
 | 
			
		||||
 | 
			
		||||
    index = sources.indexOf(source);
 | 
			
		||||
    sources.splice(index, 1);
 | 
			
		||||
    sourceCode.splice(index, 1);
 | 
			
		||||
    if (removeJs && !opts.join) {
 | 
			
		||||
      jsPath = outputPath(source, base);
 | 
			
		||||
      return exists(jsPath, function(itExists) {
 | 
			
		||||
        if (itExists) {
 | 
			
		||||
          return fs.unlink(jsPath, function(err) {
 | 
			
		||||
            if (err && err.code !== 'ENOENT') {
 | 
			
		||||
              throw err;
 | 
			
		||||
            }
 | 
			
		||||
            return timeLog("removed " + source);
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  outputPath = function(source, base, extension) {
 | 
			
		||||
    var baseDir, basename, dir, srcDir;
 | 
			
		||||
 | 
			
		||||
    if (extension == null) {
 | 
			
		||||
      extension = ".js";
 | 
			
		||||
    }
 | 
			
		||||
    basename = helpers.baseFileName(source, true, path.sep);
 | 
			
		||||
    srcDir = path.dirname(source);
 | 
			
		||||
    baseDir = base === '.' ? srcDir : srcDir.substring(base.length);
 | 
			
		||||
    dir = opts.output ? path.join(opts.output, baseDir) : srcDir;
 | 
			
		||||
    return path.join(dir, basename + extension);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) {
 | 
			
		||||
    var compile, jsDir, sourceMapPath;
 | 
			
		||||
 | 
			
		||||
    if (generatedSourceMap == null) {
 | 
			
		||||
      generatedSourceMap = null;
 | 
			
		||||
    }
 | 
			
		||||
    sourceMapPath = outputPath(sourcePath, base, ".map");
 | 
			
		||||
    jsDir = path.dirname(jsPath);
 | 
			
		||||
    compile = function() {
 | 
			
		||||
      if (opts.compile) {
 | 
			
		||||
        if (js.length <= 0) {
 | 
			
		||||
          js = ' ';
 | 
			
		||||
        }
 | 
			
		||||
        if (generatedSourceMap) {
 | 
			
		||||
          js = "" + js + "\n/*\n//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, path.sep)) + "\n*/\n";
 | 
			
		||||
        }
 | 
			
		||||
        fs.writeFile(jsPath, js, function(err) {
 | 
			
		||||
          if (err) {
 | 
			
		||||
            return printLine(err.message);
 | 
			
		||||
          } else if (opts.compile && opts.watch) {
 | 
			
		||||
            return timeLog("compiled " + sourcePath);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
      if (generatedSourceMap) {
 | 
			
		||||
        return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) {
 | 
			
		||||
          if (err) {
 | 
			
		||||
            return printLine("Could not write source map: " + err.message);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
    return exists(jsDir, function(itExists) {
 | 
			
		||||
      if (itExists) {
 | 
			
		||||
        return compile();
 | 
			
		||||
      } else {
 | 
			
		||||
        return exec("mkdir -p " + jsDir, compile);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  wait = function(milliseconds, func) {
 | 
			
		||||
    return setTimeout(func, milliseconds);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  timeLog = function(message) {
 | 
			
		||||
    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, _results;
 | 
			
		||||
 | 
			
		||||
      _results = [];
 | 
			
		||||
      for (_i = 0, _len = tokens.length; _i < _len; _i++) {
 | 
			
		||||
        token = tokens[_i];
 | 
			
		||||
        tag = token[0];
 | 
			
		||||
        value = token[1].toString().replace(/\n/, '\\n');
 | 
			
		||||
        _results.push("[" + tag + " " + value + "]");
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    })();
 | 
			
		||||
    return printLine(strings.join(' '));
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  parseOptions = function() {
 | 
			
		||||
    var i, o, source, _i, _len;
 | 
			
		||||
 | 
			
		||||
    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.map);
 | 
			
		||||
    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;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  compileOptions = function(filename, base) {
 | 
			
		||||
    var answer, cwd, jsDir, jsPath;
 | 
			
		||||
 | 
			
		||||
    answer = {
 | 
			
		||||
      filename: filename,
 | 
			
		||||
      literate: helpers.isLiterate(filename),
 | 
			
		||||
      bare: opts.bare,
 | 
			
		||||
      header: opts.compile,
 | 
			
		||||
      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, path.sep)
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        answer = helpers.merge(answer, {
 | 
			
		||||
          sourceRoot: "",
 | 
			
		||||
          sourceFiles: [helpers.baseFileName(filename, false, path.sep)],
 | 
			
		||||
          generatedFile: helpers.baseFileName(filename, true, path.sep) + ".js"
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return answer;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  forkNode = function() {
 | 
			
		||||
    var args, nodeArgs;
 | 
			
		||||
 | 
			
		||||
    nodeArgs = opts.nodejs.split(/\s+/);
 | 
			
		||||
    args = process.argv.slice(1);
 | 
			
		||||
    args.splice(args.indexOf('--nodejs'), 2);
 | 
			
		||||
    return spawn(process.execPath, nodeArgs.concat(args), {
 | 
			
		||||
      cwd: process.cwd(),
 | 
			
		||||
      env: process.env,
 | 
			
		||||
      customFds: [0, 1, 2]
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  usage = function() {
 | 
			
		||||
    return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help());
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  version = function() {
 | 
			
		||||
    return printLine("CoffeeScript version " + CoffeeScript.VERSION);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										625
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/grammar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										625
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/grammar.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,625 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
 | 
			
		||||
 | 
			
		||||
  Parser = require('jison').Parser;
 | 
			
		||||
 | 
			
		||||
  unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
 | 
			
		||||
 | 
			
		||||
  o = function(patternString, action, options) {
 | 
			
		||||
    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.$&');
 | 
			
		||||
    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')
 | 
			
		||||
    ],
 | 
			
		||||
    Body: [
 | 
			
		||||
      o('Line', function() {
 | 
			
		||||
        return Block.wrap([$1]);
 | 
			
		||||
      }), o('Body TERMINATOR Line', function() {
 | 
			
		||||
        return $1.push($3);
 | 
			
		||||
      }), o('Body TERMINATOR')
 | 
			
		||||
    ],
 | 
			
		||||
    Line: [o('Expression'), o('Statement')],
 | 
			
		||||
    Statement: [
 | 
			
		||||
      o('Return'), o('Comment'), o('STATEMENT', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')],
 | 
			
		||||
    Block: [
 | 
			
		||||
      o('INDENT OUTDENT', function() {
 | 
			
		||||
        return new Block;
 | 
			
		||||
      }), o('INDENT Body OUTDENT', function() {
 | 
			
		||||
        return $2;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Identifier: [
 | 
			
		||||
      o('IDENTIFIER', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    AlphaNumeric: [
 | 
			
		||||
      o('NUMBER', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      }), o('STRING', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Literal: [
 | 
			
		||||
      o('AlphaNumeric'), o('JS', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      }), o('REGEX', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      }), o('DEBUGGER', function() {
 | 
			
		||||
        return new Literal($1);
 | 
			
		||||
      }), o('UNDEFINED', function() {
 | 
			
		||||
        return new Undefined;
 | 
			
		||||
      }), o('NULL', function() {
 | 
			
		||||
        return new Null;
 | 
			
		||||
      }), o('BOOL', function() {
 | 
			
		||||
        return new Bool($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Assign: [
 | 
			
		||||
      o('Assignable = Expression', function() {
 | 
			
		||||
        return new Assign($1, $3);
 | 
			
		||||
      }), o('Assignable = TERMINATOR Expression', function() {
 | 
			
		||||
        return new Assign($1, $4);
 | 
			
		||||
      }), o('Assignable = INDENT Expression OUTDENT', function() {
 | 
			
		||||
        return new Assign($1, $4);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    AssignObj: [
 | 
			
		||||
      o('ObjAssignable', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('ObjAssignable : Expression', function() {
 | 
			
		||||
        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')],
 | 
			
		||||
    Return: [
 | 
			
		||||
      o('RETURN Expression', function() {
 | 
			
		||||
        return new Return($2);
 | 
			
		||||
      }), o('RETURN', function() {
 | 
			
		||||
        return new Return;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Comment: [
 | 
			
		||||
      o('HERECOMMENT', function() {
 | 
			
		||||
        return new Comment($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Code: [
 | 
			
		||||
      o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() {
 | 
			
		||||
        return new Code($2, $5, $4);
 | 
			
		||||
      }), o('FuncGlyph Block', function() {
 | 
			
		||||
        return new Code([], $2, $1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    FuncGlyph: [
 | 
			
		||||
      o('->', function() {
 | 
			
		||||
        return 'func';
 | 
			
		||||
      }), o('=>', function() {
 | 
			
		||||
        return 'boundfunc';
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    OptComma: [o(''), o(',')],
 | 
			
		||||
    ParamList: [
 | 
			
		||||
      o('', function() {
 | 
			
		||||
        return [];
 | 
			
		||||
      }), o('Param', function() {
 | 
			
		||||
        return [$1];
 | 
			
		||||
      }), o('ParamList , Param', function() {
 | 
			
		||||
        return $1.concat($3);
 | 
			
		||||
      }), o('ParamList OptComma TERMINATOR Param', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Param: [
 | 
			
		||||
      o('ParamVar', function() {
 | 
			
		||||
        return new Param($1);
 | 
			
		||||
      }), o('ParamVar ...', function() {
 | 
			
		||||
        return new Param($1, null, true);
 | 
			
		||||
      }), o('ParamVar = Expression', function() {
 | 
			
		||||
        return new Param($1, $3);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')],
 | 
			
		||||
    Splat: [
 | 
			
		||||
      o('Expression ...', function() {
 | 
			
		||||
        return new Splat($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    SimpleAssignable: [
 | 
			
		||||
      o('Identifier', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('Value Accessor', function() {
 | 
			
		||||
        return $1.add($2);
 | 
			
		||||
      }), o('Invocation Accessor', function() {
 | 
			
		||||
        return new Value($1, [].concat($2));
 | 
			
		||||
      }), o('ThisProperty')
 | 
			
		||||
    ],
 | 
			
		||||
    Assignable: [
 | 
			
		||||
      o('SimpleAssignable'), o('Array', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('Object', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Value: [
 | 
			
		||||
      o('Assignable'), o('Literal', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('Parenthetical', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('Range', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('This')
 | 
			
		||||
    ],
 | 
			
		||||
    Accessor: [
 | 
			
		||||
      o('.  Identifier', function() {
 | 
			
		||||
        return new Access($2);
 | 
			
		||||
      }), o('?. Identifier', function() {
 | 
			
		||||
        return new Access($2, 'soak');
 | 
			
		||||
      }), o(':: Identifier', function() {
 | 
			
		||||
        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')
 | 
			
		||||
    ],
 | 
			
		||||
    Index: [
 | 
			
		||||
      o('INDEX_START IndexValue INDEX_END', function() {
 | 
			
		||||
        return $2;
 | 
			
		||||
      }), o('INDEX_SOAK  Index', function() {
 | 
			
		||||
        return extend($2, {
 | 
			
		||||
          soak: true
 | 
			
		||||
        });
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    IndexValue: [
 | 
			
		||||
      o('Expression', function() {
 | 
			
		||||
        return new Index($1);
 | 
			
		||||
      }), o('Slice', function() {
 | 
			
		||||
        return new Slice($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Object: [
 | 
			
		||||
      o('{ AssignList OptComma }', function() {
 | 
			
		||||
        return new Obj($2, $1.generated);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    AssignList: [
 | 
			
		||||
      o('', function() {
 | 
			
		||||
        return [];
 | 
			
		||||
      }), o('AssignObj', function() {
 | 
			
		||||
        return [$1];
 | 
			
		||||
      }), o('AssignList , AssignObj', function() {
 | 
			
		||||
        return $1.concat($3);
 | 
			
		||||
      }), o('AssignList OptComma TERMINATOR AssignObj', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Class: [
 | 
			
		||||
      o('CLASS', function() {
 | 
			
		||||
        return new Class;
 | 
			
		||||
      }), o('CLASS Block', function() {
 | 
			
		||||
        return new Class(null, null, $2);
 | 
			
		||||
      }), o('CLASS EXTENDS Expression', function() {
 | 
			
		||||
        return new Class(null, $3);
 | 
			
		||||
      }), o('CLASS EXTENDS Expression Block', function() {
 | 
			
		||||
        return new Class(null, $3, $4);
 | 
			
		||||
      }), o('CLASS SimpleAssignable', function() {
 | 
			
		||||
        return new Class($2);
 | 
			
		||||
      }), o('CLASS SimpleAssignable Block', function() {
 | 
			
		||||
        return new Class($2, null, $3);
 | 
			
		||||
      }), o('CLASS SimpleAssignable EXTENDS Expression', function() {
 | 
			
		||||
        return new Class($2, $4);
 | 
			
		||||
      }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() {
 | 
			
		||||
        return new Class($2, $4, $5);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Invocation: [
 | 
			
		||||
      o('Value OptFuncExist Arguments', function() {
 | 
			
		||||
        return new Call($1, $3, $2);
 | 
			
		||||
      }), o('Invocation OptFuncExist Arguments', function() {
 | 
			
		||||
        return new Call($1, $3, $2);
 | 
			
		||||
      }), o('SUPER', function() {
 | 
			
		||||
        return new Call('super', [new Splat(new Literal('arguments'))]);
 | 
			
		||||
      }), o('SUPER Arguments', function() {
 | 
			
		||||
        return new Call('super', $2);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    OptFuncExist: [
 | 
			
		||||
      o('', function() {
 | 
			
		||||
        return false;
 | 
			
		||||
      }), o('FUNC_EXIST', function() {
 | 
			
		||||
        return true;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Arguments: [
 | 
			
		||||
      o('CALL_START CALL_END', function() {
 | 
			
		||||
        return [];
 | 
			
		||||
      }), o('CALL_START ArgList OptComma CALL_END', function() {
 | 
			
		||||
        return $2;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    This: [
 | 
			
		||||
      o('THIS', function() {
 | 
			
		||||
        return new Value(new Literal('this'));
 | 
			
		||||
      }), o('@', function() {
 | 
			
		||||
        return new Value(new Literal('this'));
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ThisProperty: [
 | 
			
		||||
      o('@ Identifier', function() {
 | 
			
		||||
        return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this');
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Array: [
 | 
			
		||||
      o('[ ]', function() {
 | 
			
		||||
        return new Arr([]);
 | 
			
		||||
      }), o('[ ArgList OptComma ]', function() {
 | 
			
		||||
        return new Arr($2);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    RangeDots: [
 | 
			
		||||
      o('..', function() {
 | 
			
		||||
        return 'inclusive';
 | 
			
		||||
      }), o('...', function() {
 | 
			
		||||
        return 'exclusive';
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Range: [
 | 
			
		||||
      o('[ Expression RangeDots Expression ]', function() {
 | 
			
		||||
        return new Range($2, $4, $3);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Slice: [
 | 
			
		||||
      o('Expression RangeDots Expression', function() {
 | 
			
		||||
        return new Range($1, $3, $2);
 | 
			
		||||
      }), o('Expression RangeDots', function() {
 | 
			
		||||
        return new Range($1, null, $2);
 | 
			
		||||
      }), o('RangeDots Expression', function() {
 | 
			
		||||
        return new Range(null, $2, $1);
 | 
			
		||||
      }), o('RangeDots', function() {
 | 
			
		||||
        return new Range(null, null, $1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ArgList: [
 | 
			
		||||
      o('Arg', function() {
 | 
			
		||||
        return [$1];
 | 
			
		||||
      }), o('ArgList , Arg', function() {
 | 
			
		||||
        return $1.concat($3);
 | 
			
		||||
      }), o('ArgList OptComma TERMINATOR Arg', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      }), o('INDENT ArgList OptComma OUTDENT', function() {
 | 
			
		||||
        return $2;
 | 
			
		||||
      }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() {
 | 
			
		||||
        return $1.concat($4);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Arg: [o('Expression'), o('Splat')],
 | 
			
		||||
    SimpleArgs: [
 | 
			
		||||
      o('Expression'), o('SimpleArgs , Expression', function() {
 | 
			
		||||
        return [].concat($1, $3);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Try: [
 | 
			
		||||
      o('TRY Block', function() {
 | 
			
		||||
        return new Try($2);
 | 
			
		||||
      }), o('TRY Block Catch', function() {
 | 
			
		||||
        return new Try($2, $3[0], $3[1]);
 | 
			
		||||
      }), o('TRY Block FINALLY Block', function() {
 | 
			
		||||
        return new Try($2, null, null, $4);
 | 
			
		||||
      }), o('TRY Block Catch FINALLY Block', function() {
 | 
			
		||||
        return new Try($2, $3[0], $3[1], $5);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Catch: [
 | 
			
		||||
      o('CATCH Identifier Block', function() {
 | 
			
		||||
        return [$2, $3];
 | 
			
		||||
      }), o('CATCH Object Block', function() {
 | 
			
		||||
        return [LOC(2)(new Value($2)), $3];
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Throw: [
 | 
			
		||||
      o('THROW Expression', function() {
 | 
			
		||||
        return new Throw($2);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Parenthetical: [
 | 
			
		||||
      o('( Body )', function() {
 | 
			
		||||
        return new Parens($2);
 | 
			
		||||
      }), o('( INDENT Body OUTDENT )', function() {
 | 
			
		||||
        return new Parens($3);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    WhileSource: [
 | 
			
		||||
      o('WHILE Expression', function() {
 | 
			
		||||
        return new While($2);
 | 
			
		||||
      }), o('WHILE Expression WHEN Expression', function() {
 | 
			
		||||
        return new While($2, {
 | 
			
		||||
          guard: $4
 | 
			
		||||
        });
 | 
			
		||||
      }), o('UNTIL Expression', function() {
 | 
			
		||||
        return new While($2, {
 | 
			
		||||
          invert: true
 | 
			
		||||
        });
 | 
			
		||||
      }), o('UNTIL Expression WHEN Expression', function() {
 | 
			
		||||
        return new While($2, {
 | 
			
		||||
          invert: true,
 | 
			
		||||
          guard: $4
 | 
			
		||||
        });
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    While: [
 | 
			
		||||
      o('WhileSource Block', function() {
 | 
			
		||||
        return $1.addBody($2);
 | 
			
		||||
      }), o('Statement  WhileSource', function() {
 | 
			
		||||
        return $2.addBody(LOC(1)(Block.wrap([$1])));
 | 
			
		||||
      }), o('Expression WhileSource', function() {
 | 
			
		||||
        return $2.addBody(LOC(1)(Block.wrap([$1])));
 | 
			
		||||
      }), o('Loop', function() {
 | 
			
		||||
        return $1;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Loop: [
 | 
			
		||||
      o('LOOP Block', function() {
 | 
			
		||||
        return new While(LOC(1)(new Literal('true'))).addBody($2);
 | 
			
		||||
      }), o('LOOP Expression', function() {
 | 
			
		||||
        return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2])));
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    For: [
 | 
			
		||||
      o('Statement  ForBody', function() {
 | 
			
		||||
        return new For($1, $2);
 | 
			
		||||
      }), o('Expression ForBody', function() {
 | 
			
		||||
        return new For($1, $2);
 | 
			
		||||
      }), o('ForBody    Block', function() {
 | 
			
		||||
        return new For($2, $1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ForBody: [
 | 
			
		||||
      o('FOR Range', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: LOC(2)(new Value($2))
 | 
			
		||||
        };
 | 
			
		||||
      }), o('ForStart ForSource', function() {
 | 
			
		||||
        $2.own = $1.own;
 | 
			
		||||
        $2.name = $1[0];
 | 
			
		||||
        $2.index = $1[1];
 | 
			
		||||
        return $2;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ForStart: [
 | 
			
		||||
      o('FOR ForVariables', function() {
 | 
			
		||||
        return $2;
 | 
			
		||||
      }), o('FOR OWN ForVariables', function() {
 | 
			
		||||
        $3.own = true;
 | 
			
		||||
        return $3;
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ForValue: [
 | 
			
		||||
      o('Identifier'), o('ThisProperty'), o('Array', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      }), o('Object', function() {
 | 
			
		||||
        return new Value($1);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ForVariables: [
 | 
			
		||||
      o('ForValue', function() {
 | 
			
		||||
        return [$1];
 | 
			
		||||
      }), o('ForValue , ForValue', function() {
 | 
			
		||||
        return [$1, $3];
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    ForSource: [
 | 
			
		||||
      o('FORIN Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FOROF Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          object: true
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FORIN Expression WHEN Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          guard: $4
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FOROF Expression WHEN Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          guard: $4,
 | 
			
		||||
          object: true
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FORIN Expression BY Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          step: $4
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FORIN Expression WHEN Expression BY Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          guard: $4,
 | 
			
		||||
          step: $6
 | 
			
		||||
        };
 | 
			
		||||
      }), o('FORIN Expression BY Expression WHEN Expression', function() {
 | 
			
		||||
        return {
 | 
			
		||||
          source: $2,
 | 
			
		||||
          step: $4,
 | 
			
		||||
          guard: $6
 | 
			
		||||
        };
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Switch: [
 | 
			
		||||
      o('SWITCH Expression INDENT Whens OUTDENT', function() {
 | 
			
		||||
        return new Switch($2, $4);
 | 
			
		||||
      }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() {
 | 
			
		||||
        return new Switch($2, $4, $6);
 | 
			
		||||
      }), o('SWITCH INDENT Whens OUTDENT', function() {
 | 
			
		||||
        return new Switch(null, $3);
 | 
			
		||||
      }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() {
 | 
			
		||||
        return new Switch(null, $3, $5);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Whens: [
 | 
			
		||||
      o('When'), o('Whens When', function() {
 | 
			
		||||
        return $1.concat($2);
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    When: [
 | 
			
		||||
      o('LEADING_WHEN SimpleArgs Block', function() {
 | 
			
		||||
        return [[$2, $3]];
 | 
			
		||||
      }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() {
 | 
			
		||||
        return [[$2, $3]];
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    IfBlock: [
 | 
			
		||||
      o('IF Expression Block', function() {
 | 
			
		||||
        return new If($2, $3, {
 | 
			
		||||
          type: $1
 | 
			
		||||
        });
 | 
			
		||||
      }), o('IfBlock ELSE IF Expression Block', function() {
 | 
			
		||||
        return $1.addElse(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, LOC(1)(Block.wrap([$1])), {
 | 
			
		||||
          type: $2,
 | 
			
		||||
          statement: true
 | 
			
		||||
        });
 | 
			
		||||
      }), o('Expression POST_IF Expression', function() {
 | 
			
		||||
        return new If($3, LOC(1)(Block.wrap([$1])), {
 | 
			
		||||
          type: $2,
 | 
			
		||||
          statement: true
 | 
			
		||||
        });
 | 
			
		||||
      })
 | 
			
		||||
    ],
 | 
			
		||||
    Operation: [
 | 
			
		||||
      o('UNARY Expression', function() {
 | 
			
		||||
        return new Op($1, $2);
 | 
			
		||||
      }), o('-     Expression', (function() {
 | 
			
		||||
        return new Op('-', $2);
 | 
			
		||||
      }), {
 | 
			
		||||
        prec: 'UNARY'
 | 
			
		||||
      }), o('+     Expression', (function() {
 | 
			
		||||
        return new Op('+', $2);
 | 
			
		||||
      }), {
 | 
			
		||||
        prec: 'UNARY'
 | 
			
		||||
      }), o('-- SimpleAssignable', function() {
 | 
			
		||||
        return new Op('--', $2);
 | 
			
		||||
      }), o('++ SimpleAssignable', function() {
 | 
			
		||||
        return new Op('++', $2);
 | 
			
		||||
      }), o('SimpleAssignable --', function() {
 | 
			
		||||
        return new Op('--', $1, null, true);
 | 
			
		||||
      }), o('SimpleAssignable ++', function() {
 | 
			
		||||
        return new Op('++', $1, null, true);
 | 
			
		||||
      }), o('Expression ?', function() {
 | 
			
		||||
        return new Existence($1);
 | 
			
		||||
      }), o('Expression +  Expression', function() {
 | 
			
		||||
        return new Op('+', $1, $3);
 | 
			
		||||
      }), o('Expression -  Expression', function() {
 | 
			
		||||
        return new Op('-', $1, $3);
 | 
			
		||||
      }), o('Expression MATH     Expression', function() {
 | 
			
		||||
        return new Op($2, $1, $3);
 | 
			
		||||
      }), o('Expression SHIFT    Expression', function() {
 | 
			
		||||
        return new Op($2, $1, $3);
 | 
			
		||||
      }), o('Expression COMPARE  Expression', function() {
 | 
			
		||||
        return new Op($2, $1, $3);
 | 
			
		||||
      }), o('Expression LOGIC    Expression', function() {
 | 
			
		||||
        return new Op($2, $1, $3);
 | 
			
		||||
      }), o('Expression RELATION Expression', function() {
 | 
			
		||||
        if ($2.charAt(0) === '!') {
 | 
			
		||||
          return new Op($2.slice(1), $1, $3).invert();
 | 
			
		||||
        } else {
 | 
			
		||||
          return new Op($2, $1, $3);
 | 
			
		||||
        }
 | 
			
		||||
      }), o('SimpleAssignable COMPOUND_ASSIGN\
 | 
			
		||||
       Expression', function() {
 | 
			
		||||
        return new Assign($1, $3, $2);
 | 
			
		||||
      }), 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);
 | 
			
		||||
      })
 | 
			
		||||
    ]
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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']];
 | 
			
		||||
 | 
			
		||||
  tokens = [];
 | 
			
		||||
 | 
			
		||||
  for (name in grammar) {
 | 
			
		||||
    alternatives = grammar[name];
 | 
			
		||||
    grammar[name] = (function() {
 | 
			
		||||
      var _i, _j, _len, _len1, _ref, _results;
 | 
			
		||||
 | 
			
		||||
      _results = [];
 | 
			
		||||
      for (_i = 0, _len = alternatives.length; _i < _len; _i++) {
 | 
			
		||||
        alt = alternatives[_i];
 | 
			
		||||
        _ref = alt[0].split(' ');
 | 
			
		||||
        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
 | 
			
		||||
          token = _ref[_j];
 | 
			
		||||
          if (!grammar[token]) {
 | 
			
		||||
            tokens.push(token);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        if (name === 'Root') {
 | 
			
		||||
          alt[1] = "return " + alt[1];
 | 
			
		||||
        }
 | 
			
		||||
        _results.push(alt);
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    })();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  exports.parser = new Parser({
 | 
			
		||||
    tokens: tokens.join(' '),
 | 
			
		||||
    bnf: grammar,
 | 
			
		||||
    operators: operators.reverse(),
 | 
			
		||||
    startSymbol: 'Root'
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										236
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/helpers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										236
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/helpers.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,236 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var buildLocationData, extend, flatten, last, repeat, _ref;
 | 
			
		||||
 | 
			
		||||
  exports.starts = function(string, literal, start) {
 | 
			
		||||
    return literal === string.substr(start, literal.length);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.ends = function(string, literal, back) {
 | 
			
		||||
    var len;
 | 
			
		||||
 | 
			
		||||
    len = literal.length;
 | 
			
		||||
    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 = [];
 | 
			
		||||
    for (_i = 0, _len = array.length; _i < _len; _i++) {
 | 
			
		||||
      item = array[_i];
 | 
			
		||||
      if (item) {
 | 
			
		||||
        _results.push(item);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return _results;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.count = function(string, substr) {
 | 
			
		||||
    var num, pos;
 | 
			
		||||
 | 
			
		||||
    num = pos = 0;
 | 
			
		||||
    if (!substr.length) {
 | 
			
		||||
      return 1 / 0;
 | 
			
		||||
    }
 | 
			
		||||
    while (pos = 1 + string.indexOf(substr, pos)) {
 | 
			
		||||
      num++;
 | 
			
		||||
    }
 | 
			
		||||
    return num;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.merge = function(options, overrides) {
 | 
			
		||||
    return extend(extend({}, options), overrides);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  extend = exports.extend = function(object, properties) {
 | 
			
		||||
    var key, val;
 | 
			
		||||
 | 
			
		||||
    for (key in properties) {
 | 
			
		||||
      val = properties[key];
 | 
			
		||||
      object[key] = val;
 | 
			
		||||
    }
 | 
			
		||||
    return object;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.flatten = flatten = function(array) {
 | 
			
		||||
    var element, flattened, _i, _len;
 | 
			
		||||
 | 
			
		||||
    flattened = [];
 | 
			
		||||
    for (_i = 0, _len = array.length; _i < _len; _i++) {
 | 
			
		||||
      element = array[_i];
 | 
			
		||||
      if (element instanceof Array) {
 | 
			
		||||
        flattened = flattened.concat(flatten(element));
 | 
			
		||||
      } else {
 | 
			
		||||
        flattened.push(element);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return flattened;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.del = function(obj, key) {
 | 
			
		||||
    var val;
 | 
			
		||||
 | 
			
		||||
    val = obj[key];
 | 
			
		||||
    delete obj[key];
 | 
			
		||||
    return val;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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, pathSep) {
 | 
			
		||||
    var parts;
 | 
			
		||||
 | 
			
		||||
    if (stripExt == null) {
 | 
			
		||||
      stripExt = false;
 | 
			
		||||
    }
 | 
			
		||||
    if (pathSep == null) {
 | 
			
		||||
      pathSep = '/';
 | 
			
		||||
    }
 | 
			
		||||
    parts = file.split(pathSep);
 | 
			
		||||
    file = parts[parts.length - 1];
 | 
			
		||||
    if (!stripExt) {
 | 
			
		||||
      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, _ref1, _ref2;
 | 
			
		||||
 | 
			
		||||
    if ((_ref1 = location.last_line) == null) {
 | 
			
		||||
      location.last_line = location.first_line;
 | 
			
		||||
    }
 | 
			
		||||
    if ((_ref2 = location.last_column) == null) {
 | 
			
		||||
      location.last_column = location.first_column;
 | 
			
		||||
    }
 | 
			
		||||
    error = new SyntaxError(message);
 | 
			
		||||
    error.location = location;
 | 
			
		||||
    throw error;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.prettyErrorMessage = function(error, fileName, code, useColors) {
 | 
			
		||||
    var codeLine, colorize, end, first_column, first_line, last_column, last_line, marker, message, start, _ref1;
 | 
			
		||||
 | 
			
		||||
    if (!error.location) {
 | 
			
		||||
      return error.stack || ("" + error);
 | 
			
		||||
    }
 | 
			
		||||
    _ref1 = error.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column;
 | 
			
		||||
    codeLine = code.split('\n')[first_line];
 | 
			
		||||
    start = first_column;
 | 
			
		||||
    end = first_line === last_line ? last_column + 1 : codeLine.length;
 | 
			
		||||
    marker = repeat(' ', start) + repeat('^', end - start);
 | 
			
		||||
    if (useColors) {
 | 
			
		||||
      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);
 | 
			
		||||
    }
 | 
			
		||||
    message = "" + fileName + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + error.message + "\n" + codeLine + "\n" + marker;
 | 
			
		||||
    return message;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var key, val, _ref;
 | 
			
		||||
 | 
			
		||||
  _ref = require('./coffee-script');
 | 
			
		||||
  for (key in _ref) {
 | 
			
		||||
    val = _ref[key];
 | 
			
		||||
    exports[key] = val;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										914
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/lexer.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										914
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/lexer.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,914 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  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, 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, invertLiterate, key, last, locationDataToString, 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, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
 | 
			
		||||
 | 
			
		||||
  exports.Lexer = Lexer = (function() {
 | 
			
		||||
    function Lexer() {}
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.tokenize = function(code, opts) {
 | 
			
		||||
      var consumed, i, tag, _ref2;
 | 
			
		||||
 | 
			
		||||
      if (opts == null) {
 | 
			
		||||
        opts = {};
 | 
			
		||||
      }
 | 
			
		||||
      this.literate = opts.literate;
 | 
			
		||||
      this.indent = 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)) {
 | 
			
		||||
        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()) {
 | 
			
		||||
        this.error("missing " + tag);
 | 
			
		||||
      }
 | 
			
		||||
      if (opts.rewrite === false) {
 | 
			
		||||
        return this.tokens;
 | 
			
		||||
      }
 | 
			
		||||
      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, 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 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@');
 | 
			
		||||
      tag = 'IDENTIFIER';
 | 
			
		||||
      if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
 | 
			
		||||
        tag = id.toUpperCase();
 | 
			
		||||
        if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) {
 | 
			
		||||
          tag = 'LEADING_WHEN';
 | 
			
		||||
        } else if (tag === 'FOR') {
 | 
			
		||||
          this.seenFor = true;
 | 
			
		||||
        } else if (tag === 'UNLESS') {
 | 
			
		||||
          tag = 'IF';
 | 
			
		||||
        } else if (__indexOf.call(UNARY, tag) >= 0) {
 | 
			
		||||
          tag = 'UNARY';
 | 
			
		||||
        } else if (__indexOf.call(RELATION, tag) >= 0) {
 | 
			
		||||
          if (tag !== 'INSTANCEOF' && this.seenFor) {
 | 
			
		||||
            tag = 'FOR' + tag;
 | 
			
		||||
            this.seenFor = false;
 | 
			
		||||
          } else {
 | 
			
		||||
            tag = 'RELATION';
 | 
			
		||||
            if (this.value() === '!') {
 | 
			
		||||
              poppedToken = this.tokens.pop();
 | 
			
		||||
              id = '!' + id;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (__indexOf.call(JS_FORBIDDEN, id) >= 0) {
 | 
			
		||||
        if (forcedIdentifier) {
 | 
			
		||||
          tag = 'IDENTIFIER';
 | 
			
		||||
          id = new String(id);
 | 
			
		||||
          id.reserved = true;
 | 
			
		||||
        } else if (__indexOf.call(RESERVED, id) >= 0) {
 | 
			
		||||
          this.error("reserved word \"" + id + "\"");
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (!forcedIdentifier) {
 | 
			
		||||
        if (__indexOf.call(COFFEE_ALIASES, id) >= 0) {
 | 
			
		||||
          id = COFFEE_ALIAS_MAP[id];
 | 
			
		||||
        }
 | 
			
		||||
        tag = (function() {
 | 
			
		||||
          switch (id) {
 | 
			
		||||
            case '!':
 | 
			
		||||
              return 'UNARY';
 | 
			
		||||
            case '==':
 | 
			
		||||
            case '!=':
 | 
			
		||||
              return 'COMPARE';
 | 
			
		||||
            case '&&':
 | 
			
		||||
            case '||':
 | 
			
		||||
              return 'LOGIC';
 | 
			
		||||
            case 'true':
 | 
			
		||||
            case 'false':
 | 
			
		||||
              return 'BOOL';
 | 
			
		||||
            case 'break':
 | 
			
		||||
            case 'continue':
 | 
			
		||||
              return 'STATEMENT';
 | 
			
		||||
            default:
 | 
			
		||||
              return tag;
 | 
			
		||||
          }
 | 
			
		||||
        })();
 | 
			
		||||
      }
 | 
			
		||||
      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) {
 | 
			
		||||
        colonOffset = input.lastIndexOf(':');
 | 
			
		||||
        this.token(':', ':', colonOffset, colon.length);
 | 
			
		||||
      }
 | 
			
		||||
      return input.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.numberToken = function() {
 | 
			
		||||
      var binaryLiteral, lexedLength, match, number, octalLiteral;
 | 
			
		||||
 | 
			
		||||
      if (!(match = NUMBER.exec(this.chunk))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      number = match[0];
 | 
			
		||||
      if (/^0[BOX]/.test(number)) {
 | 
			
		||||
        this.error("radix prefix '" + number + "' must be lowercase");
 | 
			
		||||
      } else if (/E/.test(number) && !/^0x/.test(number)) {
 | 
			
		||||
        this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'");
 | 
			
		||||
      } else if (/^0\d*[89]/.test(number)) {
 | 
			
		||||
        this.error("decimal literal '" + number + "' must not be prefixed with '0'");
 | 
			
		||||
      } else if (/^0\d+/.test(number)) {
 | 
			
		||||
        this.error("octal literal '" + number + "' must be prefixed with '0o'");
 | 
			
		||||
      }
 | 
			
		||||
      lexedLength = number.length;
 | 
			
		||||
      if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
 | 
			
		||||
        number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16);
 | 
			
		||||
      }
 | 
			
		||||
      if (binaryLiteral = /^0b([01]+)/.exec(number)) {
 | 
			
		||||
        number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16);
 | 
			
		||||
      }
 | 
			
		||||
      this.token('NUMBER', number, 0, lexedLength);
 | 
			
		||||
      return lexedLength;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.stringToken = function() {
 | 
			
		||||
      var match, octalEsc, string;
 | 
			
		||||
 | 
			
		||||
      switch (this.chunk.charAt(0)) {
 | 
			
		||||
        case "'":
 | 
			
		||||
          if (!(match = SIMPLESTR.exec(this.chunk))) {
 | 
			
		||||
            return 0;
 | 
			
		||||
          }
 | 
			
		||||
          string = match[0];
 | 
			
		||||
          this.token('STRING', string.replace(MULTILINER, '\\\n'), 0, string.length);
 | 
			
		||||
          break;
 | 
			
		||||
        case '"':
 | 
			
		||||
          if (!(string = this.balancedString(this.chunk, '"'))) {
 | 
			
		||||
            return 0;
 | 
			
		||||
          }
 | 
			
		||||
          if (0 < string.indexOf('#{', 1)) {
 | 
			
		||||
            this.interpolateString(string.slice(1, -1), {
 | 
			
		||||
              strOffset: 1,
 | 
			
		||||
              lexedLength: string.length
 | 
			
		||||
            });
 | 
			
		||||
          } else {
 | 
			
		||||
            this.token('STRING', this.escapeLines(string, 0, string.length));
 | 
			
		||||
          }
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          return 0;
 | 
			
		||||
      }
 | 
			
		||||
      if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
 | 
			
		||||
        this.error("octal escape sequences " + string + " are not allowed");
 | 
			
		||||
      }
 | 
			
		||||
      return string.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.heredocToken = function() {
 | 
			
		||||
      var doc, heredoc, match, quote;
 | 
			
		||||
 | 
			
		||||
      if (!(match = HEREDOC.exec(this.chunk))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      heredoc = match[0];
 | 
			
		||||
      quote = heredoc.charAt(0);
 | 
			
		||||
      doc = this.sanitizeHeredoc(match[2], {
 | 
			
		||||
        quote: quote,
 | 
			
		||||
        indent: null
 | 
			
		||||
      });
 | 
			
		||||
      if (quote === '"' && 0 <= doc.indexOf('#{')) {
 | 
			
		||||
        this.interpolateString(doc, {
 | 
			
		||||
          heredoc: true,
 | 
			
		||||
          strOffset: 3,
 | 
			
		||||
          lexedLength: heredoc.length
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length);
 | 
			
		||||
      }
 | 
			
		||||
      return heredoc.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.commentToken = function() {
 | 
			
		||||
      var comment, here, match;
 | 
			
		||||
 | 
			
		||||
      if (!(match = this.chunk.match(COMMENT))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      comment = match[0], here = match[1];
 | 
			
		||||
      if (here) {
 | 
			
		||||
        this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
 | 
			
		||||
          herecomment: true,
 | 
			
		||||
          indent: Array(this.indent + 1).join(' ')
 | 
			
		||||
        }), 0, comment.length);
 | 
			
		||||
      }
 | 
			
		||||
      return comment.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.jsToken = function() {
 | 
			
		||||
      var match, script;
 | 
			
		||||
 | 
			
		||||
      if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      this.token('JS', (script = match[0]).slice(1, -1), 0, script.length);
 | 
			
		||||
      return script.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.regexToken = function() {
 | 
			
		||||
      var flags, length, match, prev, regex, _ref2, _ref3;
 | 
			
		||||
 | 
			
		||||
      if (this.chunk.charAt(0) !== '/') {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      if (match = HEREGEX.exec(this.chunk)) {
 | 
			
		||||
        length = this.heregexToken(match);
 | 
			
		||||
        return length;
 | 
			
		||||
      }
 | 
			
		||||
      prev = last(this.tokens);
 | 
			
		||||
      if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      if (!(match = REGEX.exec(this.chunk))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2];
 | 
			
		||||
      if (regex.slice(0, 2) === '/*') {
 | 
			
		||||
        this.error('regular expressions cannot begin with `*`');
 | 
			
		||||
      }
 | 
			
		||||
      if (regex === '//') {
 | 
			
		||||
        regex = '/(?:)/';
 | 
			
		||||
      }
 | 
			
		||||
      this.token('REGEX', "" + regex + flags, 0, match.length);
 | 
			
		||||
      return match.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.heregexToken = function(match) {
 | 
			
		||||
      var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
 | 
			
		||||
 | 
			
		||||
      heregex = match[0], body = match[1], flags = match[2];
 | 
			
		||||
      if (0 > body.indexOf('#{')) {
 | 
			
		||||
        re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
 | 
			
		||||
        if (re.match(/^\*/)) {
 | 
			
		||||
          this.error('regular expressions cannot begin with `*`');
 | 
			
		||||
        }
 | 
			
		||||
        this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length);
 | 
			
		||||
        return heregex.length;
 | 
			
		||||
      }
 | 
			
		||||
      this.token('IDENTIFIER', 'RegExp', 0, 0);
 | 
			
		||||
      this.token('CALL_START', '(', 0, 0);
 | 
			
		||||
      tokens = [];
 | 
			
		||||
      _ref2 = this.interpolateString(body, {
 | 
			
		||||
        regex: true
 | 
			
		||||
      });
 | 
			
		||||
      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
 | 
			
		||||
        token = _ref2[_i];
 | 
			
		||||
        tag = token[0], value = token[1];
 | 
			
		||||
        if (tag === 'TOKENS') {
 | 
			
		||||
          tokens.push.apply(tokens, value);
 | 
			
		||||
        } else if (tag === 'NEOSTRING') {
 | 
			
		||||
          if (!(value = value.replace(HEREGEX_OMIT, ''))) {
 | 
			
		||||
            continue;
 | 
			
		||||
          }
 | 
			
		||||
          value = value.replace(/\\/g, '\\\\');
 | 
			
		||||
          token[0] = 'STRING';
 | 
			
		||||
          token[1] = this.makeString(value, '"', true);
 | 
			
		||||
          tokens.push(token);
 | 
			
		||||
        } else {
 | 
			
		||||
          this.error("Unexpected " + tag);
 | 
			
		||||
        }
 | 
			
		||||
        prev = last(this.tokens);
 | 
			
		||||
        plusToken = ['+', '+'];
 | 
			
		||||
        plusToken[2] = prev[2];
 | 
			
		||||
        tokens.push(plusToken);
 | 
			
		||||
      }
 | 
			
		||||
      tokens.pop();
 | 
			
		||||
      if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') {
 | 
			
		||||
        this.token('STRING', '""', 0, 0);
 | 
			
		||||
        this.token('+', '+', 0, 0);
 | 
			
		||||
      }
 | 
			
		||||
      (_ref4 = this.tokens).push.apply(_ref4, tokens);
 | 
			
		||||
      if (flags) {
 | 
			
		||||
        flagsOffset = heregex.lastIndexOf(flags);
 | 
			
		||||
        this.token(',', ',', flagsOffset, 0);
 | 
			
		||||
        this.token('STRING', '"' + flags + '"', flagsOffset, flags.length);
 | 
			
		||||
      }
 | 
			
		||||
      this.token(')', ')', heregex.length - 1, 0);
 | 
			
		||||
      return heregex.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.lineToken = function() {
 | 
			
		||||
      var diff, indent, match, noNewlines, size;
 | 
			
		||||
 | 
			
		||||
      if (!(match = MULTI_DENT.exec(this.chunk))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      indent = match[0];
 | 
			
		||||
      this.seenFor = false;
 | 
			
		||||
      size = indent.length - 1 - indent.lastIndexOf('\n');
 | 
			
		||||
      noNewlines = this.unfinished();
 | 
			
		||||
      if (size - this.indebt === this.indent) {
 | 
			
		||||
        if (noNewlines) {
 | 
			
		||||
          this.suppressNewlines();
 | 
			
		||||
        } else {
 | 
			
		||||
          this.newlineToken(0);
 | 
			
		||||
        }
 | 
			
		||||
        return indent.length;
 | 
			
		||||
      }
 | 
			
		||||
      if (size > this.indent) {
 | 
			
		||||
        if (noNewlines) {
 | 
			
		||||
          this.indebt = size - this.indent;
 | 
			
		||||
          this.suppressNewlines();
 | 
			
		||||
          return indent.length;
 | 
			
		||||
        }
 | 
			
		||||
        diff = size - this.indent + this.outdebt;
 | 
			
		||||
        this.token('INDENT', diff, indent.length - size, size);
 | 
			
		||||
        this.indents.push(diff);
 | 
			
		||||
        this.ends.push('OUTDENT');
 | 
			
		||||
        this.outdebt = this.indebt = 0;
 | 
			
		||||
      } else {
 | 
			
		||||
        this.indebt = 0;
 | 
			
		||||
        this.outdentToken(this.indent - size, noNewlines, indent.length);
 | 
			
		||||
      }
 | 
			
		||||
      this.indent = size;
 | 
			
		||||
      return indent.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
 | 
			
		||||
      var dent, len;
 | 
			
		||||
 | 
			
		||||
      while (moveOut > 0) {
 | 
			
		||||
        len = this.indents.length - 1;
 | 
			
		||||
        if (this.indents[len] === void 0) {
 | 
			
		||||
          moveOut = 0;
 | 
			
		||||
        } else if (this.indents[len] === 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 {
 | 
			
		||||
          dent = this.indents.pop() + this.outdebt;
 | 
			
		||||
          moveOut -= dent;
 | 
			
		||||
          this.outdebt = 0;
 | 
			
		||||
          this.pair('OUTDENT');
 | 
			
		||||
          this.token('OUTDENT', dent, 0, outdentLength);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (dent) {
 | 
			
		||||
        this.outdebt -= moveOut;
 | 
			
		||||
      }
 | 
			
		||||
      while (this.value() === ';') {
 | 
			
		||||
        this.tokens.pop();
 | 
			
		||||
      }
 | 
			
		||||
      if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
 | 
			
		||||
        this.token('TERMINATOR', '\n', outdentLength, 0);
 | 
			
		||||
      }
 | 
			
		||||
      return this;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.whitespaceToken = function() {
 | 
			
		||||
      var match, nline, prev;
 | 
			
		||||
 | 
			
		||||
      if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
      prev = last(this.tokens);
 | 
			
		||||
      if (prev) {
 | 
			
		||||
        prev[match ? 'spaced' : 'newLine'] = true;
 | 
			
		||||
      }
 | 
			
		||||
      if (match) {
 | 
			
		||||
        return match[0].length;
 | 
			
		||||
      } else {
 | 
			
		||||
        return 0;
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.newlineToken = function(offset) {
 | 
			
		||||
      while (this.value() === ';') {
 | 
			
		||||
        this.tokens.pop();
 | 
			
		||||
      }
 | 
			
		||||
      if (this.tag() !== 'TERMINATOR') {
 | 
			
		||||
        this.token('TERMINATOR', '\n', offset, 0);
 | 
			
		||||
      }
 | 
			
		||||
      return this;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.suppressNewlines = function() {
 | 
			
		||||
      if (this.value() === '\\') {
 | 
			
		||||
        this.tokens.pop();
 | 
			
		||||
      }
 | 
			
		||||
      return this;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.literalToken = function() {
 | 
			
		||||
      var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
 | 
			
		||||
 | 
			
		||||
      if (match = OPERATOR.exec(this.chunk)) {
 | 
			
		||||
        value = match[0];
 | 
			
		||||
        if (CODE.test(value)) {
 | 
			
		||||
          this.tagParameters();
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        value = this.chunk.charAt(0);
 | 
			
		||||
      }
 | 
			
		||||
      tag = value;
 | 
			
		||||
      prev = last(this.tokens);
 | 
			
		||||
      if (value === '=' && prev) {
 | 
			
		||||
        if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) {
 | 
			
		||||
          this.error("reserved word \"" + (this.value()) + "\" can't be assigned");
 | 
			
		||||
        }
 | 
			
		||||
        if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') {
 | 
			
		||||
          prev[0] = 'COMPOUND_ASSIGN';
 | 
			
		||||
          prev[1] += '=';
 | 
			
		||||
          return value.length;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (value === ';') {
 | 
			
		||||
        this.seenFor = false;
 | 
			
		||||
        tag = 'TERMINATOR';
 | 
			
		||||
      } else if (__indexOf.call(MATH, value) >= 0) {
 | 
			
		||||
        tag = 'MATH';
 | 
			
		||||
      } else if (__indexOf.call(COMPARE, value) >= 0) {
 | 
			
		||||
        tag = 'COMPARE';
 | 
			
		||||
      } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) {
 | 
			
		||||
        tag = 'COMPOUND_ASSIGN';
 | 
			
		||||
      } else if (__indexOf.call(UNARY, value) >= 0) {
 | 
			
		||||
        tag = 'UNARY';
 | 
			
		||||
      } else if (__indexOf.call(SHIFT, value) >= 0) {
 | 
			
		||||
        tag = 'SHIFT';
 | 
			
		||||
      } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
 | 
			
		||||
        tag = 'LOGIC';
 | 
			
		||||
      } else if (prev && !prev.spaced) {
 | 
			
		||||
        if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) {
 | 
			
		||||
          if (prev[0] === '?') {
 | 
			
		||||
            prev[0] = 'FUNC_EXIST';
 | 
			
		||||
          }
 | 
			
		||||
          tag = 'CALL_START';
 | 
			
		||||
        } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) {
 | 
			
		||||
          tag = 'INDEX_START';
 | 
			
		||||
          switch (prev[0]) {
 | 
			
		||||
            case '?':
 | 
			
		||||
              prev[0] = 'INDEX_SOAK';
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      switch (value) {
 | 
			
		||||
        case '(':
 | 
			
		||||
        case '{':
 | 
			
		||||
        case '[':
 | 
			
		||||
          this.ends.push(INVERSES[value]);
 | 
			
		||||
          break;
 | 
			
		||||
        case ')':
 | 
			
		||||
        case '}':
 | 
			
		||||
        case ']':
 | 
			
		||||
          this.pair(value);
 | 
			
		||||
      }
 | 
			
		||||
      this.token(tag, value);
 | 
			
		||||
      return value.length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.sanitizeHeredoc = function(doc, options) {
 | 
			
		||||
      var attempt, herecomment, indent, match, _ref2;
 | 
			
		||||
 | 
			
		||||
      indent = options.indent, herecomment = options.herecomment;
 | 
			
		||||
      if (herecomment) {
 | 
			
		||||
        if (HEREDOC_ILLEGAL.test(doc)) {
 | 
			
		||||
          this.error("block comment cannot contain \"*/\", starting");
 | 
			
		||||
        }
 | 
			
		||||
        if (doc.indexOf('\n') < 0) {
 | 
			
		||||
          return doc;
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        while (match = HEREDOC_INDENT.exec(doc)) {
 | 
			
		||||
          attempt = match[1];
 | 
			
		||||
          if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) {
 | 
			
		||||
            indent = attempt;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (indent) {
 | 
			
		||||
        doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
 | 
			
		||||
      }
 | 
			
		||||
      if (!herecomment) {
 | 
			
		||||
        doc = doc.replace(/^\n/, '');
 | 
			
		||||
      }
 | 
			
		||||
      return doc;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.tagParameters = function() {
 | 
			
		||||
      var i, stack, tok, tokens;
 | 
			
		||||
 | 
			
		||||
      if (this.tag() !== ')') {
 | 
			
		||||
        return this;
 | 
			
		||||
      }
 | 
			
		||||
      stack = [];
 | 
			
		||||
      tokens = this.tokens;
 | 
			
		||||
      i = tokens.length;
 | 
			
		||||
      tokens[--i][0] = 'PARAM_END';
 | 
			
		||||
      while (tok = tokens[--i]) {
 | 
			
		||||
        switch (tok[0]) {
 | 
			
		||||
          case ')':
 | 
			
		||||
            stack.push(tok);
 | 
			
		||||
            break;
 | 
			
		||||
          case '(':
 | 
			
		||||
          case 'CALL_START':
 | 
			
		||||
            if (stack.length) {
 | 
			
		||||
              stack.pop();
 | 
			
		||||
            } else if (tok[0] === '(') {
 | 
			
		||||
              tok[0] = 'PARAM_START';
 | 
			
		||||
              return this;
 | 
			
		||||
            } else {
 | 
			
		||||
              return this;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return this;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.closeIndentation = function() {
 | 
			
		||||
      return this.outdentToken(this.indent);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.balancedString = function(str, end) {
 | 
			
		||||
      var continueCount, i, letter, match, prev, stack, _i, _ref2;
 | 
			
		||||
 | 
			
		||||
      continueCount = 0;
 | 
			
		||||
      stack = [end];
 | 
			
		||||
      for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) {
 | 
			
		||||
        if (continueCount) {
 | 
			
		||||
          --continueCount;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        switch (letter = str.charAt(i)) {
 | 
			
		||||
          case '\\':
 | 
			
		||||
            ++continueCount;
 | 
			
		||||
            continue;
 | 
			
		||||
          case end:
 | 
			
		||||
            stack.pop();
 | 
			
		||||
            if (!stack.length) {
 | 
			
		||||
              return str.slice(0, +i + 1 || 9e9);
 | 
			
		||||
            }
 | 
			
		||||
            end = stack[stack.length - 1];
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
        if (end === '}' && (letter === '"' || letter === "'")) {
 | 
			
		||||
          stack.push(end = letter);
 | 
			
		||||
        } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) {
 | 
			
		||||
          continueCount += match[0].length - 1;
 | 
			
		||||
        } else if (end === '}' && letter === '{') {
 | 
			
		||||
          stack.push(end = '}');
 | 
			
		||||
        } else if (end === '"' && prev === '#' && letter === '{') {
 | 
			
		||||
          stack.push(end = '}');
 | 
			
		||||
        }
 | 
			
		||||
        prev = letter;
 | 
			
		||||
      }
 | 
			
		||||
      return this.error("missing " + (stack.pop()) + ", starting");
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.interpolateString = function(str, options) {
 | 
			
		||||
      var column, 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, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength;
 | 
			
		||||
      offsetInChunk = offsetInChunk || 0;
 | 
			
		||||
      strOffset = strOffset || 0;
 | 
			
		||||
      lexedLength = lexedLength || str.length;
 | 
			
		||||
      if (heredoc && str.length > 0 && str[0] === '\n') {
 | 
			
		||||
        str = str.slice(1);
 | 
			
		||||
        strOffset++;
 | 
			
		||||
      }
 | 
			
		||||
      tokens = [];
 | 
			
		||||
      pi = 0;
 | 
			
		||||
      i = -1;
 | 
			
		||||
      while (letter = str.charAt(i += 1)) {
 | 
			
		||||
        if (letter === '\\') {
 | 
			
		||||
          i += 1;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) {
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        if (pi < i) {
 | 
			
		||||
          tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi));
 | 
			
		||||
        }
 | 
			
		||||
        inner = expr.slice(1, -1);
 | 
			
		||||
        if (inner.length) {
 | 
			
		||||
          _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1];
 | 
			
		||||
          nested = new Lexer().tokenize(inner, {
 | 
			
		||||
            line: line,
 | 
			
		||||
            column: column,
 | 
			
		||||
            rewrite: false
 | 
			
		||||
          });
 | 
			
		||||
          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.makeToken('(', '(', strOffset + i + 1, 0));
 | 
			
		||||
              nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0));
 | 
			
		||||
            }
 | 
			
		||||
            tokens.push(['TOKENS', nested]);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        i += expr.length;
 | 
			
		||||
        pi = i + 1;
 | 
			
		||||
      }
 | 
			
		||||
      if ((i > pi && pi < str.length)) {
 | 
			
		||||
        tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi));
 | 
			
		||||
      }
 | 
			
		||||
      if (regex) {
 | 
			
		||||
        return tokens;
 | 
			
		||||
      }
 | 
			
		||||
      if (!tokens.length) {
 | 
			
		||||
        return this.token('STRING', '""', offsetInChunk, lexedLength);
 | 
			
		||||
      }
 | 
			
		||||
      if (tokens[0][0] !== 'NEOSTRING') {
 | 
			
		||||
        tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk));
 | 
			
		||||
      }
 | 
			
		||||
      if (interpolated = tokens.length > 1) {
 | 
			
		||||
        this.token('(', '(', offsetInChunk, 0);
 | 
			
		||||
      }
 | 
			
		||||
      for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) {
 | 
			
		||||
        token = tokens[i];
 | 
			
		||||
        tag = token[0], value = token[1];
 | 
			
		||||
        if (i) {
 | 
			
		||||
          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.error("Unexpected " + tag);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (interpolated) {
 | 
			
		||||
        rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0);
 | 
			
		||||
        rparen.stringEnd = true;
 | 
			
		||||
        this.tokens.push(rparen);
 | 
			
		||||
      }
 | 
			
		||||
      return tokens;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.pair = function(tag) {
 | 
			
		||||
      var size, wanted;
 | 
			
		||||
 | 
			
		||||
      if (tag !== (wanted = last(this.ends))) {
 | 
			
		||||
        if ('OUTDENT' !== wanted) {
 | 
			
		||||
          this.error("unmatched " + tag);
 | 
			
		||||
        }
 | 
			
		||||
        this.indent -= size = last(this.indents);
 | 
			
		||||
        this.outdentToken(size, true);
 | 
			
		||||
        return this.pair(tag);
 | 
			
		||||
      }
 | 
			
		||||
      return this.ends.pop();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    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) {
 | 
			
		||||
      var token;
 | 
			
		||||
 | 
			
		||||
      token = this.makeToken(tag, value, offsetInChunk, length);
 | 
			
		||||
      this.tokens.push(token);
 | 
			
		||||
      return token;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.tag = function(index, tag) {
 | 
			
		||||
      var tok;
 | 
			
		||||
 | 
			
		||||
      return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.value = function(index, val) {
 | 
			
		||||
      var tok;
 | 
			
		||||
 | 
			
		||||
      return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.unfinished = function() {
 | 
			
		||||
      var _ref2;
 | 
			
		||||
 | 
			
		||||
      return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.escapeLines = function(str, heredoc) {
 | 
			
		||||
      return str.replace(MULTILINER, heredoc ? '\\n' : '');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    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) {
 | 
			
		||||
          return contents;
 | 
			
		||||
        } else {
 | 
			
		||||
          return match;
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      body = body.replace(RegExp("" + quote, "g"), '\\$&');
 | 
			
		||||
      return quote + this.escapeLines(body, heredoc) + quote;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Lexer.prototype.error = function(message) {
 | 
			
		||||
      return throwSyntaxError(message, {
 | 
			
		||||
        first_line: this.chunkLine,
 | 
			
		||||
        first_column: this.chunkColumn
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return Lexer;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super'];
 | 
			
		||||
 | 
			
		||||
  COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
 | 
			
		||||
 | 
			
		||||
  COFFEE_ALIAS_MAP = {
 | 
			
		||||
    and: '&&',
 | 
			
		||||
    or: '||',
 | 
			
		||||
    is: '==',
 | 
			
		||||
    isnt: '!=',
 | 
			
		||||
    not: '!',
 | 
			
		||||
    yes: 'true',
 | 
			
		||||
    no: 'false',
 | 
			
		||||
    on: 'true',
 | 
			
		||||
    off: 'false'
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  COFFEE_ALIASES = (function() {
 | 
			
		||||
    var _results;
 | 
			
		||||
 | 
			
		||||
    _results = [];
 | 
			
		||||
    for (key in COFFEE_ALIAS_MAP) {
 | 
			
		||||
      _results.push(key);
 | 
			
		||||
    }
 | 
			
		||||
    return _results;
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  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', 'package', 'private', 'protected', 'public', 'static', 'yield'];
 | 
			
		||||
 | 
			
		||||
  STRICT_PROSCRIBED = ['arguments', 'eval'];
 | 
			
		||||
 | 
			
		||||
  JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED);
 | 
			
		||||
 | 
			
		||||
  exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED);
 | 
			
		||||
 | 
			
		||||
  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/;
 | 
			
		||||
 | 
			
		||||
  OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/;
 | 
			
		||||
 | 
			
		||||
  WHITESPACE = /^[^\n\S]+/;
 | 
			
		||||
 | 
			
		||||
  COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)$)|^(?:\s*#(?!##[^#]).*)+/;
 | 
			
		||||
 | 
			
		||||
  CODE = /^[-=]>/;
 | 
			
		||||
 | 
			
		||||
  MULTI_DENT = /^(?:\n[^\n\S]*)+/;
 | 
			
		||||
 | 
			
		||||
  SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
 | 
			
		||||
 | 
			
		||||
  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_OMIT = /\s+(?:#.*)?/g;
 | 
			
		||||
 | 
			
		||||
  MULTILINER = /\n/g;
 | 
			
		||||
 | 
			
		||||
  HEREDOC_INDENT = /\n+([^\n\S]*)/g;
 | 
			
		||||
 | 
			
		||||
  HEREDOC_ILLEGAL = /\*\//;
 | 
			
		||||
 | 
			
		||||
  LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/;
 | 
			
		||||
 | 
			
		||||
  TRAILING_SPACES = /\s+$/;
 | 
			
		||||
 | 
			
		||||
  COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
 | 
			
		||||
 | 
			
		||||
  UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO'];
 | 
			
		||||
 | 
			
		||||
  LOGIC = ['&&', '||', '&', '|', '^'];
 | 
			
		||||
 | 
			
		||||
  SHIFT = ['<<', '>>', '>>>'];
 | 
			
		||||
 | 
			
		||||
  COMPARE = ['==', '!=', '<', '>', '<=', '>='];
 | 
			
		||||
 | 
			
		||||
  MATH = ['*', '/', '%'];
 | 
			
		||||
 | 
			
		||||
  RELATION = ['IN', 'OF', 'INSTANCEOF'];
 | 
			
		||||
 | 
			
		||||
  BOOL = ['TRUE', 'FALSE'];
 | 
			
		||||
 | 
			
		||||
  NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'];
 | 
			
		||||
 | 
			
		||||
  NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
 | 
			
		||||
 | 
			
		||||
  CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
 | 
			
		||||
 | 
			
		||||
  INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED');
 | 
			
		||||
 | 
			
		||||
  LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										3145
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/nodes.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3145
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/nodes.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										142
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/optparse.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										142
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/optparse.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,142 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
 | 
			
		||||
 | 
			
		||||
  exports.OptionParser = OptionParser = (function() {
 | 
			
		||||
    function OptionParser(rules, banner) {
 | 
			
		||||
      this.banner = banner;
 | 
			
		||||
      this.rules = buildRules(rules);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    OptionParser.prototype.parse = function(args) {
 | 
			
		||||
      var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref;
 | 
			
		||||
 | 
			
		||||
      options = {
 | 
			
		||||
        "arguments": []
 | 
			
		||||
      };
 | 
			
		||||
      skippingArgument = false;
 | 
			
		||||
      originalArgs = args;
 | 
			
		||||
      args = normalizeArguments(args);
 | 
			
		||||
      for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
 | 
			
		||||
        arg = args[i];
 | 
			
		||||
        if (skippingArgument) {
 | 
			
		||||
          skippingArgument = false;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        if (arg === '--') {
 | 
			
		||||
          pos = originalArgs.indexOf('--');
 | 
			
		||||
          options["arguments"] = options["arguments"].concat(originalArgs.slice(pos + 1));
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
        isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG));
 | 
			
		||||
        seenNonOptionArg = options["arguments"].length > 0;
 | 
			
		||||
        if (!seenNonOptionArg) {
 | 
			
		||||
          matchedRule = false;
 | 
			
		||||
          _ref = this.rules;
 | 
			
		||||
          for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
 | 
			
		||||
            rule = _ref[_j];
 | 
			
		||||
            if (rule.shortFlag === arg || rule.longFlag === arg) {
 | 
			
		||||
              value = true;
 | 
			
		||||
              if (rule.hasArgument) {
 | 
			
		||||
                skippingArgument = true;
 | 
			
		||||
                value = args[i + 1];
 | 
			
		||||
              }
 | 
			
		||||
              options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value;
 | 
			
		||||
              matchedRule = true;
 | 
			
		||||
              break;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          if (isOption && !matchedRule) {
 | 
			
		||||
            throw new Error("unrecognized option: " + arg);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        if (seenNonOptionArg || !isOption) {
 | 
			
		||||
          options["arguments"].push(arg);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return options;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    OptionParser.prototype.help = function() {
 | 
			
		||||
      var letPart, lines, rule, spaces, _i, _len, _ref;
 | 
			
		||||
 | 
			
		||||
      lines = [];
 | 
			
		||||
      if (this.banner) {
 | 
			
		||||
        lines.unshift("" + this.banner + "\n");
 | 
			
		||||
      }
 | 
			
		||||
      _ref = this.rules;
 | 
			
		||||
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
 | 
			
		||||
        rule = _ref[_i];
 | 
			
		||||
        spaces = 15 - rule.longFlag.length;
 | 
			
		||||
        spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
 | 
			
		||||
        letPart = rule.shortFlag ? rule.shortFlag + ', ' : '    ';
 | 
			
		||||
        lines.push('  ' + letPart + rule.longFlag + spaces + rule.description);
 | 
			
		||||
      }
 | 
			
		||||
      return "\n" + (lines.join('\n')) + "\n";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return OptionParser;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  LONG_FLAG = /^(--\w[\w\-]*)/;
 | 
			
		||||
 | 
			
		||||
  SHORT_FLAG = /^(-\w)$/;
 | 
			
		||||
 | 
			
		||||
  MULTI_FLAG = /^-(\w{2,})/;
 | 
			
		||||
 | 
			
		||||
  OPTIONAL = /\[(\w+(\*?))\]/;
 | 
			
		||||
 | 
			
		||||
  buildRules = function(rules) {
 | 
			
		||||
    var tuple, _i, _len, _results;
 | 
			
		||||
 | 
			
		||||
    _results = [];
 | 
			
		||||
    for (_i = 0, _len = rules.length; _i < _len; _i++) {
 | 
			
		||||
      tuple = rules[_i];
 | 
			
		||||
      if (tuple.length < 3) {
 | 
			
		||||
        tuple.unshift(null);
 | 
			
		||||
      }
 | 
			
		||||
      _results.push(buildRule.apply(null, tuple));
 | 
			
		||||
    }
 | 
			
		||||
    return _results;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  buildRule = function(shortFlag, longFlag, description, options) {
 | 
			
		||||
    var match;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    match = longFlag.match(OPTIONAL);
 | 
			
		||||
    longFlag = longFlag.match(LONG_FLAG)[1];
 | 
			
		||||
    return {
 | 
			
		||||
      name: longFlag.substr(2),
 | 
			
		||||
      shortFlag: shortFlag,
 | 
			
		||||
      longFlag: longFlag,
 | 
			
		||||
      description: description,
 | 
			
		||||
      hasArgument: !!(match && match[1]),
 | 
			
		||||
      isList: !!(match && match[2])
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  normalizeArguments = function(args) {
 | 
			
		||||
    var arg, l, match, result, _i, _j, _len, _len1, _ref;
 | 
			
		||||
 | 
			
		||||
    args = args.slice(0);
 | 
			
		||||
    result = [];
 | 
			
		||||
    for (_i = 0, _len = args.length; _i < _len; _i++) {
 | 
			
		||||
      arg = args[_i];
 | 
			
		||||
      if (match = arg.match(MULTI_FLAG)) {
 | 
			
		||||
        _ref = match[1].split('');
 | 
			
		||||
        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
 | 
			
		||||
          l = _ref[_j];
 | 
			
		||||
          result.push('-' + l);
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        result.push(arg);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return result;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										608
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/parser.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										608
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/parser.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										115
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/repl.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/repl.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,115 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var CoffeeScript, addMultilineHandler, merge, nodeREPL, prettyErrorMessage, replDefaults, vm, _ref;
 | 
			
		||||
 | 
			
		||||
  vm = require('vm');
 | 
			
		||||
 | 
			
		||||
  nodeREPL = require('repl');
 | 
			
		||||
 | 
			
		||||
  CoffeeScript = require('./coffee-script');
 | 
			
		||||
 | 
			
		||||
  _ref = require('./helpers'), merge = _ref.merge, prettyErrorMessage = _ref.prettyErrorMessage;
 | 
			
		||||
 | 
			
		||||
  replDefaults = {
 | 
			
		||||
    prompt: 'coffee> ',
 | 
			
		||||
    "eval": function(input, context, filename, cb) {
 | 
			
		||||
      var Assign, Block, Literal, Value, ast, err, js, _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 {
 | 
			
		||||
        ast = CoffeeScript.nodes(input);
 | 
			
		||||
        ast = new Block([new Assign(new Value(new Literal('_')), ast, '=')]);
 | 
			
		||||
        js = ast.compile({
 | 
			
		||||
          bare: true,
 | 
			
		||||
          locals: Object.keys(context)
 | 
			
		||||
        });
 | 
			
		||||
        return cb(null, vm.runInContext(js, context, filename));
 | 
			
		||||
      } catch (_error) {
 | 
			
		||||
        err = _error;
 | 
			
		||||
        return cb(prettyErrorMessage(err, filename, input, true));
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  addMultilineHandler = function(repl) {
 | 
			
		||||
    var inputStream, multiline, nodeLineListener, outputStream, rli;
 | 
			
		||||
 | 
			
		||||
    rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream;
 | 
			
		||||
    multiline = {
 | 
			
		||||
      enabled: false,
 | 
			
		||||
      initialPrompt: repl.prompt.replace(/^[^> ]*/, function(x) {
 | 
			
		||||
        return x.replace(/./g, '-');
 | 
			
		||||
      }),
 | 
			
		||||
      prompt: repl.prompt.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 {
 | 
			
		||||
        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(repl.prompt);
 | 
			
		||||
          rli.prompt(true);
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        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);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
      }
 | 
			
		||||
      opts = merge(replDefaults, opts);
 | 
			
		||||
      repl = nodeREPL.start(opts);
 | 
			
		||||
      repl.on('exit', function() {
 | 
			
		||||
        return repl.outputStream.write('\n');
 | 
			
		||||
      });
 | 
			
		||||
      addMultilineHandler(repl);
 | 
			
		||||
      return repl;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										509
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/rewriter.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										509
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/rewriter.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,509 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(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, 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;
 | 
			
		||||
 | 
			
		||||
  generate = function(tag, value) {
 | 
			
		||||
    var tok;
 | 
			
		||||
 | 
			
		||||
    tok = [tag, value];
 | 
			
		||||
    tok.generated = true;
 | 
			
		||||
    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.tagPostfixConditionals();
 | 
			
		||||
      this.addImplicitBracesAndParens();
 | 
			
		||||
      this.addLocationDataToGeneratedTokens();
 | 
			
		||||
      return this.tokens;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.scanTokens = function(block) {
 | 
			
		||||
      var i, token, tokens;
 | 
			
		||||
 | 
			
		||||
      tokens = this.tokens;
 | 
			
		||||
      i = 0;
 | 
			
		||||
      while (token = tokens[i]) {
 | 
			
		||||
        i += block.call(this, token, i, tokens);
 | 
			
		||||
      }
 | 
			
		||||
      return true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.detectEnd = function(i, condition, action) {
 | 
			
		||||
      var levels, token, tokens, _ref, _ref1;
 | 
			
		||||
 | 
			
		||||
      tokens = this.tokens;
 | 
			
		||||
      levels = 0;
 | 
			
		||||
      while (token = tokens[i]) {
 | 
			
		||||
        if (levels === 0 && condition.call(this, token, i)) {
 | 
			
		||||
          return action.call(this, token, i);
 | 
			
		||||
        }
 | 
			
		||||
        if (!token || levels < 0) {
 | 
			
		||||
          return action.call(this, token, i - 1);
 | 
			
		||||
        }
 | 
			
		||||
        if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) {
 | 
			
		||||
          levels += 1;
 | 
			
		||||
        } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) {
 | 
			
		||||
          levels -= 1;
 | 
			
		||||
        }
 | 
			
		||||
        i += 1;
 | 
			
		||||
      }
 | 
			
		||||
      return i - 1;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.removeLeadingNewlines = function() {
 | 
			
		||||
      var i, tag, _i, _len, _ref;
 | 
			
		||||
 | 
			
		||||
      _ref = this.tokens;
 | 
			
		||||
      for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
 | 
			
		||||
        tag = _ref[i][0];
 | 
			
		||||
        if (tag !== 'TERMINATOR') {
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (i) {
 | 
			
		||||
        return this.tokens.splice(0, i);
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    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) {
 | 
			
		||||
        var _ref;
 | 
			
		||||
 | 
			
		||||
        return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
 | 
			
		||||
      };
 | 
			
		||||
      action = function(token, i) {
 | 
			
		||||
        return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
 | 
			
		||||
      };
 | 
			
		||||
      return this.scanTokens(function(token, i) {
 | 
			
		||||
        if (token[0] === 'CALL_START') {
 | 
			
		||||
          this.detectEnd(i + 1, condition, action);
 | 
			
		||||
        }
 | 
			
		||||
        return 1;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.closeOpenIndexes = function() {
 | 
			
		||||
      var action, condition;
 | 
			
		||||
 | 
			
		||||
      condition = function(token, i) {
 | 
			
		||||
        var _ref;
 | 
			
		||||
 | 
			
		||||
        return (_ref = token[0]) === ']' || _ref === 'INDEX_END';
 | 
			
		||||
      };
 | 
			
		||||
      action = function(token, i) {
 | 
			
		||||
        return token[0] = 'INDEX_END';
 | 
			
		||||
      };
 | 
			
		||||
      return this.scanTokens(function(token, i) {
 | 
			
		||||
        if (token[0] === 'INDEX_START') {
 | 
			
		||||
          this.detectEnd(i + 1, condition, action);
 | 
			
		||||
        }
 | 
			
		||||
        return 1;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    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;
 | 
			
		||||
        }
 | 
			
		||||
        if (pattern[j] == null) {
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        if (typeof pattern[j] === 'string') {
 | 
			
		||||
          pattern[j] = [pattern[j]];
 | 
			
		||||
        }
 | 
			
		||||
        if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      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));
 | 
			
		||||
        }
 | 
			
		||||
        if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) {
 | 
			
		||||
          backStack.pop();
 | 
			
		||||
        }
 | 
			
		||||
        i -= 1;
 | 
			
		||||
      }
 | 
			
		||||
      return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.addImplicitBracesAndParens = function() {
 | 
			
		||||
      var stack;
 | 
			
		||||
 | 
			
		||||
      stack = [];
 | 
			
		||||
      return this.scanTokens(function(token, i, tokens) {
 | 
			
		||||
        var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
 | 
			
		||||
 | 
			
		||||
        tag = token[0];
 | 
			
		||||
        prevTag = (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('{'))));
 | 
			
		||||
          if (j == null) {
 | 
			
		||||
            return i += 1;
 | 
			
		||||
          }
 | 
			
		||||
        };
 | 
			
		||||
        endImplicitObject = function(j) {
 | 
			
		||||
          j = j != null ? j : i;
 | 
			
		||||
          stack.pop();
 | 
			
		||||
          tokens.splice(j, 0, generate('}', '}'));
 | 
			
		||||
          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 === '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 (__indexOf.call(EXPRESSION_START, tag) >= 0) {
 | 
			
		||||
          stack.push([tag, i]);
 | 
			
		||||
          return forward(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
 | 
			
		||||
          while (inImplicit()) {
 | 
			
		||||
            if (inImplicitCall()) {
 | 
			
		||||
              endImplicitCall();
 | 
			
		||||
            } else if (inImplicitObject()) {
 | 
			
		||||
              endImplicitObject();
 | 
			
		||||
            } else {
 | 
			
		||||
              stack.pop();
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          stack.pop();
 | 
			
		||||
        }
 | 
			
		||||
        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 (this.matchTags(i, IMPLICIT_FUNC, '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);
 | 
			
		||||
        }
 | 
			
		||||
        if (tag === ':') {
 | 
			
		||||
          if (this.tag(i - 2) === '@') {
 | 
			
		||||
            s = i - 2;
 | 
			
		||||
          } else {
 | 
			
		||||
            s = i - 1;
 | 
			
		||||
          }
 | 
			
		||||
          while (this.tag(s - 2) === 'HERECOMMENT') {
 | 
			
		||||
            s -= 2;
 | 
			
		||||
          }
 | 
			
		||||
          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 (prevTag === 'OUTDENT' && inImplicitCall() && (tag === '.' || tag === '?.' || tag === '::' || tag === '?::')) {
 | 
			
		||||
          endImplicitCall();
 | 
			
		||||
          return forward(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) {
 | 
			
		||||
          stackTop()[2].sameLine = false;
 | 
			
		||||
        }
 | 
			
		||||
        if (__indexOf.call(IMPLICIT_END, tag) >= 0) {
 | 
			
		||||
          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() && sameLine && !startsLine) {
 | 
			
		||||
              endImplicitObject();
 | 
			
		||||
            } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
 | 
			
		||||
              endImplicitObject();
 | 
			
		||||
            } else {
 | 
			
		||||
              break;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) {
 | 
			
		||||
          offset = nextTag === 'OUTDENT' ? 1 : 0;
 | 
			
		||||
          while (inImplicitObject()) {
 | 
			
		||||
            endImplicitObject(i + offset);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        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 (!(token.generated || token.explicit)) {
 | 
			
		||||
          return 1;
 | 
			
		||||
        }
 | 
			
		||||
        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;
 | 
			
		||||
        }
 | 
			
		||||
        token[2] = {
 | 
			
		||||
          first_line: line,
 | 
			
		||||
          first_column: column,
 | 
			
		||||
          last_line: line,
 | 
			
		||||
          last_column: column
 | 
			
		||||
        };
 | 
			
		||||
        return 1;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.addImplicitIndentation = 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'));
 | 
			
		||||
      };
 | 
			
		||||
      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;
 | 
			
		||||
 | 
			
		||||
        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())));
 | 
			
		||||
          return 2;
 | 
			
		||||
        }
 | 
			
		||||
        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())));
 | 
			
		||||
          return 4;
 | 
			
		||||
        }
 | 
			
		||||
        if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
 | 
			
		||||
          starter = tag;
 | 
			
		||||
          _ref1 = this.indentation(true), indent = _ref1[0], outdent = _ref1[1];
 | 
			
		||||
          if (starter === 'THEN') {
 | 
			
		||||
            indent.fromThen = true;
 | 
			
		||||
          }
 | 
			
		||||
          tokens.splice(i + 1, 0, indent);
 | 
			
		||||
          this.detectEnd(i + 2, condition, action);
 | 
			
		||||
          if (tag === 'THEN') {
 | 
			
		||||
            tokens.splice(i, 1);
 | 
			
		||||
          }
 | 
			
		||||
          return 1;
 | 
			
		||||
        }
 | 
			
		||||
        return 1;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.tagPostfixConditionals = function() {
 | 
			
		||||
      var action, condition, original;
 | 
			
		||||
 | 
			
		||||
      original = null;
 | 
			
		||||
      condition = function(token, i) {
 | 
			
		||||
        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)) {
 | 
			
		||||
          return original[0] = 'POST_' + original[0];
 | 
			
		||||
        }
 | 
			
		||||
      };
 | 
			
		||||
      return this.scanTokens(function(token, i) {
 | 
			
		||||
        if (token[0] !== 'IF') {
 | 
			
		||||
          return 1;
 | 
			
		||||
        }
 | 
			
		||||
        original = token;
 | 
			
		||||
        this.detectEnd(i + 1, condition, action);
 | 
			
		||||
        return 1;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.indentation = function(implicit) {
 | 
			
		||||
      var indent, outdent;
 | 
			
		||||
 | 
			
		||||
      if (implicit == null) {
 | 
			
		||||
        implicit = false;
 | 
			
		||||
      }
 | 
			
		||||
      indent = ['INDENT', 2];
 | 
			
		||||
      outdent = ['OUTDENT', 2];
 | 
			
		||||
      if (implicit) {
 | 
			
		||||
        indent.generated = outdent.generated = true;
 | 
			
		||||
      }
 | 
			
		||||
      if (!implicit) {
 | 
			
		||||
        indent.explicit = outdent.explicit = true;
 | 
			
		||||
      }
 | 
			
		||||
      return [indent, outdent];
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.generate = generate;
 | 
			
		||||
 | 
			
		||||
    Rewriter.prototype.tag = function(i) {
 | 
			
		||||
      var _ref;
 | 
			
		||||
 | 
			
		||||
      return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return Rewriter;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
 | 
			
		||||
 | 
			
		||||
  exports.INVERSES = INVERSES = {};
 | 
			
		||||
 | 
			
		||||
  EXPRESSION_START = [];
 | 
			
		||||
 | 
			
		||||
  EXPRESSION_END = [];
 | 
			
		||||
 | 
			
		||||
  for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) {
 | 
			
		||||
    _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1];
 | 
			
		||||
    EXPRESSION_START.push(INVERSES[rite] = left);
 | 
			
		||||
    EXPRESSION_END.push(INVERSES[left] = rite);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  EXPRESSION_CLOSE = ['CATCH', 'WHEN', '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', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++'];
 | 
			
		||||
 | 
			
		||||
  IMPLICIT_UNSPACED_CALL = ['+', '-'];
 | 
			
		||||
 | 
			
		||||
  IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
 | 
			
		||||
 | 
			
		||||
  IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
 | 
			
		||||
 | 
			
		||||
  SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
 | 
			
		||||
 | 
			
		||||
  SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
 | 
			
		||||
 | 
			
		||||
  LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										152
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/scope.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/scope.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,152 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(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) {
 | 
			
		||||
      this.parent = parent;
 | 
			
		||||
      this.expressions = expressions;
 | 
			
		||||
      this.method = method;
 | 
			
		||||
      this.variables = [
 | 
			
		||||
        {
 | 
			
		||||
          name: 'arguments',
 | 
			
		||||
          type: 'arguments'
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
      this.positions = {};
 | 
			
		||||
      if (!this.parent) {
 | 
			
		||||
        Scope.root = this;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.add = function(name, type, immediate) {
 | 
			
		||||
      if (this.shared && !immediate) {
 | 
			
		||||
        return this.parent.add(name, type, immediate);
 | 
			
		||||
      }
 | 
			
		||||
      if (Object.prototype.hasOwnProperty.call(this.positions, name)) {
 | 
			
		||||
        return this.variables[this.positions[name]].type = type;
 | 
			
		||||
      } else {
 | 
			
		||||
        return this.positions[name] = this.variables.push({
 | 
			
		||||
          name: name,
 | 
			
		||||
          type: type
 | 
			
		||||
        }) - 1;
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.namedMethod = function() {
 | 
			
		||||
      var _ref1;
 | 
			
		||||
 | 
			
		||||
      if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) {
 | 
			
		||||
        return this.method;
 | 
			
		||||
      }
 | 
			
		||||
      return this.parent.namedMethod();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.find = function(name) {
 | 
			
		||||
      if (this.check(name)) {
 | 
			
		||||
        return true;
 | 
			
		||||
      }
 | 
			
		||||
      this.add(name, 'var');
 | 
			
		||||
      return false;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.parameter = function(name) {
 | 
			
		||||
      if (this.shared && this.parent.check(name, true)) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      return this.add(name, 'param');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.check = function(name) {
 | 
			
		||||
      var _ref1;
 | 
			
		||||
 | 
			
		||||
      return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0));
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.temporary = function(name, index) {
 | 
			
		||||
      if (name.length > 1) {
 | 
			
		||||
        return '_' + name + (index > 1 ? index - 1 : '');
 | 
			
		||||
      } else {
 | 
			
		||||
        return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a');
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.type = function(name) {
 | 
			
		||||
      var v, _i, _len, _ref1;
 | 
			
		||||
 | 
			
		||||
      _ref1 = this.variables;
 | 
			
		||||
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
 | 
			
		||||
        v = _ref1[_i];
 | 
			
		||||
        if (v.name === name) {
 | 
			
		||||
          return v.type;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return null;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.freeVariable = function(name, reserve) {
 | 
			
		||||
      var index, temp;
 | 
			
		||||
 | 
			
		||||
      if (reserve == null) {
 | 
			
		||||
        reserve = true;
 | 
			
		||||
      }
 | 
			
		||||
      index = 0;
 | 
			
		||||
      while (this.check((temp = this.temporary(name, index)))) {
 | 
			
		||||
        index++;
 | 
			
		||||
      }
 | 
			
		||||
      if (reserve) {
 | 
			
		||||
        this.add(temp, 'var', true);
 | 
			
		||||
      }
 | 
			
		||||
      return temp;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.assign = function(name, value) {
 | 
			
		||||
      this.add(name, {
 | 
			
		||||
        value: value,
 | 
			
		||||
        assigned: true
 | 
			
		||||
      }, true);
 | 
			
		||||
      return this.hasAssignments = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.hasDeclarations = function() {
 | 
			
		||||
      return !!this.declaredVariables().length;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.declaredVariables = function() {
 | 
			
		||||
      var realVars, tempVars, v, _i, _len, _ref1;
 | 
			
		||||
 | 
			
		||||
      realVars = [];
 | 
			
		||||
      tempVars = [];
 | 
			
		||||
      _ref1 = this.variables;
 | 
			
		||||
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
 | 
			
		||||
        v = _ref1[_i];
 | 
			
		||||
        if (v.type === 'var') {
 | 
			
		||||
          (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return realVars.sort().concat(tempVars.sort());
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    Scope.prototype.assignedVariables = function() {
 | 
			
		||||
      var v, _i, _len, _ref1, _results;
 | 
			
		||||
 | 
			
		||||
      _ref1 = this.variables;
 | 
			
		||||
      _results = [];
 | 
			
		||||
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
 | 
			
		||||
        v = _ref1[_i];
 | 
			
		||||
        if (v.type.assigned) {
 | 
			
		||||
          _results.push("" + v.name + " = " + v.type.value);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return Scope;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										248
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/sourcemap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										248
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/lib/coffee-script/sourcemap.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,248 @@
 | 
			
		||||
// Generated by CoffeeScript 1.6.2
 | 
			
		||||
(function() {
 | 
			
		||||
  var BASE64_CHARS, LineMapping, MAX_BASE64_VALUE, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK, decodeBase64Char, encodeBase64Char;
 | 
			
		||||
 | 
			
		||||
  LineMapping = (function() {
 | 
			
		||||
    function LineMapping(generatedLine) {
 | 
			
		||||
      this.generatedLine = generatedLine;
 | 
			
		||||
      this.columnMap = {};
 | 
			
		||||
      this.columnMappings = [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LineMapping.prototype.addMapping = function(generatedColumn, _arg, options) {
 | 
			
		||||
      var sourceColumn, sourceLine;
 | 
			
		||||
 | 
			
		||||
      sourceLine = _arg[0], sourceColumn = _arg[1];
 | 
			
		||||
      if (options == null) {
 | 
			
		||||
        options = {};
 | 
			
		||||
      }
 | 
			
		||||
      if (this.columnMap[generatedColumn] && options.noReplace) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      this.columnMap[generatedColumn] = {
 | 
			
		||||
        generatedLine: this.generatedLine,
 | 
			
		||||
        generatedColumn: generatedColumn,
 | 
			
		||||
        sourceLine: sourceLine,
 | 
			
		||||
        sourceColumn: sourceColumn
 | 
			
		||||
      };
 | 
			
		||||
      this.columnMappings.push(this.columnMap[generatedColumn]);
 | 
			
		||||
      return this.columnMappings.sort(function(a, b) {
 | 
			
		||||
        return a.generatedColumn - b.generatedColumn;
 | 
			
		||||
      });
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    LineMapping.prototype.getSourcePosition = function(generatedColumn) {
 | 
			
		||||
      var answer, columnMapping, lastColumnMapping, _i, _len, _ref;
 | 
			
		||||
 | 
			
		||||
      answer = null;
 | 
			
		||||
      lastColumnMapping = null;
 | 
			
		||||
      _ref = this.columnMappings;
 | 
			
		||||
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
 | 
			
		||||
        columnMapping = _ref[_i];
 | 
			
		||||
        if (columnMapping.generatedColumn > generatedColumn) {
 | 
			
		||||
          break;
 | 
			
		||||
        } else {
 | 
			
		||||
          lastColumnMapping = columnMapping;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (lastColumnMapping) {
 | 
			
		||||
        return answer = [lastColumnMapping.sourceLine, lastColumnMapping.sourceColumn];
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return LineMapping;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  exports.SourceMap = (function() {
 | 
			
		||||
    function SourceMap() {
 | 
			
		||||
      this.generatedLines = [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    SourceMap.prototype.addMapping = function(sourceLocation, generatedLocation, options) {
 | 
			
		||||
      var generatedColumn, generatedLine, lineMapping;
 | 
			
		||||
 | 
			
		||||
      if (options == null) {
 | 
			
		||||
        options = {};
 | 
			
		||||
      }
 | 
			
		||||
      generatedLine = generatedLocation[0], generatedColumn = generatedLocation[1];
 | 
			
		||||
      lineMapping = this.generatedLines[generatedLine];
 | 
			
		||||
      if (!lineMapping) {
 | 
			
		||||
        lineMapping = this.generatedLines[generatedLine] = new LineMapping(generatedLine);
 | 
			
		||||
      }
 | 
			
		||||
      return lineMapping.addMapping(generatedColumn, sourceLocation, options);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    SourceMap.prototype.getSourcePosition = function(_arg) {
 | 
			
		||||
      var answer, generatedColumn, generatedLine, lineMapping;
 | 
			
		||||
 | 
			
		||||
      generatedLine = _arg[0], generatedColumn = _arg[1];
 | 
			
		||||
      answer = null;
 | 
			
		||||
      lineMapping = this.generatedLines[generatedLine];
 | 
			
		||||
      if (!lineMapping) {
 | 
			
		||||
 | 
			
		||||
      } else {
 | 
			
		||||
        answer = lineMapping.getSourcePosition(generatedColumn);
 | 
			
		||||
      }
 | 
			
		||||
      return answer;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    SourceMap.prototype.forEachMapping = function(fn) {
 | 
			
		||||
      var columnMapping, generatedLineNumber, lineMapping, _i, _len, _ref, _results;
 | 
			
		||||
 | 
			
		||||
      _ref = this.generatedLines;
 | 
			
		||||
      _results = [];
 | 
			
		||||
      for (generatedLineNumber = _i = 0, _len = _ref.length; _i < _len; generatedLineNumber = ++_i) {
 | 
			
		||||
        lineMapping = _ref[generatedLineNumber];
 | 
			
		||||
        if (lineMapping) {
 | 
			
		||||
          _results.push((function() {
 | 
			
		||||
            var _j, _len1, _ref1, _results1;
 | 
			
		||||
 | 
			
		||||
            _ref1 = lineMapping.columnMappings;
 | 
			
		||||
            _results1 = [];
 | 
			
		||||
            for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
 | 
			
		||||
              columnMapping = _ref1[_j];
 | 
			
		||||
              _results1.push(fn(columnMapping));
 | 
			
		||||
            }
 | 
			
		||||
            return _results1;
 | 
			
		||||
          })());
 | 
			
		||||
        } else {
 | 
			
		||||
          _results.push(void 0);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return _results;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return SourceMap;
 | 
			
		||||
 | 
			
		||||
  })();
 | 
			
		||||
 | 
			
		||||
  exports.generateV3SourceMap = function(sourceMap, options, code) {
 | 
			
		||||
    var answer, generatedFile, lastGeneratedColumnWritten, lastSourceColumnWritten, lastSourceLineWritten, mappings, needComma, sourceFiles, sourceRoot, writingGeneratedLine;
 | 
			
		||||
 | 
			
		||||
    if (options == null) {
 | 
			
		||||
      options = {};
 | 
			
		||||
    }
 | 
			
		||||
    sourceRoot = options.sourceRoot || "";
 | 
			
		||||
    sourceFiles = options.sourceFiles || [""];
 | 
			
		||||
    generatedFile = options.generatedFile || "";
 | 
			
		||||
    writingGeneratedLine = 0;
 | 
			
		||||
    lastGeneratedColumnWritten = 0;
 | 
			
		||||
    lastSourceLineWritten = 0;
 | 
			
		||||
    lastSourceColumnWritten = 0;
 | 
			
		||||
    needComma = false;
 | 
			
		||||
    mappings = "";
 | 
			
		||||
    sourceMap.forEachMapping(function(mapping) {
 | 
			
		||||
      while (writingGeneratedLine < mapping.generatedLine) {
 | 
			
		||||
        lastGeneratedColumnWritten = 0;
 | 
			
		||||
        needComma = false;
 | 
			
		||||
        mappings += ";";
 | 
			
		||||
        writingGeneratedLine++;
 | 
			
		||||
      }
 | 
			
		||||
      if (needComma) {
 | 
			
		||||
        mappings += ",";
 | 
			
		||||
        needComma = false;
 | 
			
		||||
      }
 | 
			
		||||
      mappings += exports.vlqEncodeValue(mapping.generatedColumn - lastGeneratedColumnWritten);
 | 
			
		||||
      lastGeneratedColumnWritten = mapping.generatedColumn;
 | 
			
		||||
      mappings += exports.vlqEncodeValue(0);
 | 
			
		||||
      mappings += exports.vlqEncodeValue(mapping.sourceLine - lastSourceLineWritten);
 | 
			
		||||
      lastSourceLineWritten = mapping.sourceLine;
 | 
			
		||||
      mappings += exports.vlqEncodeValue(mapping.sourceColumn - lastSourceColumnWritten);
 | 
			
		||||
      lastSourceColumnWritten = mapping.sourceColumn;
 | 
			
		||||
      return needComma = true;
 | 
			
		||||
    });
 | 
			
		||||
    answer = {
 | 
			
		||||
      version: 3,
 | 
			
		||||
      file: generatedFile,
 | 
			
		||||
      sourceRoot: sourceRoot,
 | 
			
		||||
      sources: sourceFiles,
 | 
			
		||||
      names: [],
 | 
			
		||||
      mappings: mappings
 | 
			
		||||
    };
 | 
			
		||||
    if (options.inline) {
 | 
			
		||||
      answer.sourcesContent = [code];
 | 
			
		||||
    }
 | 
			
		||||
    return JSON.stringify(answer, null, 2);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.loadV3SourceMap = function(sourceMap) {
 | 
			
		||||
    return todo();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
 | 
			
		||||
 | 
			
		||||
  MAX_BASE64_VALUE = BASE64_CHARS.length - 1;
 | 
			
		||||
 | 
			
		||||
  encodeBase64Char = function(value) {
 | 
			
		||||
    if (value > MAX_BASE64_VALUE) {
 | 
			
		||||
      throw new Error("Cannot encode value " + value + " > " + MAX_BASE64_VALUE);
 | 
			
		||||
    } else if (value < 0) {
 | 
			
		||||
      throw new Error("Cannot encode value " + value + " < 0");
 | 
			
		||||
    }
 | 
			
		||||
    return BASE64_CHARS[value];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  decodeBase64Char = function(char) {
 | 
			
		||||
    var value;
 | 
			
		||||
 | 
			
		||||
    value = BASE64_CHARS.indexOf(char);
 | 
			
		||||
    if (value === -1) {
 | 
			
		||||
      throw new Error("Invalid Base 64 character: " + char);
 | 
			
		||||
    }
 | 
			
		||||
    return value;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  VLQ_SHIFT = 5;
 | 
			
		||||
 | 
			
		||||
  VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
 | 
			
		||||
 | 
			
		||||
  VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
 | 
			
		||||
 | 
			
		||||
  exports.vlqEncodeValue = function(value) {
 | 
			
		||||
    var answer, nextVlqChunk, signBit, valueToEncode;
 | 
			
		||||
 | 
			
		||||
    signBit = value < 0 ? 1 : 0;
 | 
			
		||||
    valueToEncode = (Math.abs(value) << 1) + signBit;
 | 
			
		||||
    answer = "";
 | 
			
		||||
    while (valueToEncode || !answer) {
 | 
			
		||||
      nextVlqChunk = valueToEncode & VLQ_VALUE_MASK;
 | 
			
		||||
      valueToEncode = valueToEncode >> VLQ_SHIFT;
 | 
			
		||||
      if (valueToEncode) {
 | 
			
		||||
        nextVlqChunk |= VLQ_CONTINUATION_BIT;
 | 
			
		||||
      }
 | 
			
		||||
      answer += encodeBase64Char(nextVlqChunk);
 | 
			
		||||
    }
 | 
			
		||||
    return answer;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  exports.vlqDecodeValue = function(str, offset) {
 | 
			
		||||
    var consumed, continuationShift, done, nextChunkValue, nextVlqChunk, position, signBit, value;
 | 
			
		||||
 | 
			
		||||
    if (offset == null) {
 | 
			
		||||
      offset = 0;
 | 
			
		||||
    }
 | 
			
		||||
    position = offset;
 | 
			
		||||
    done = false;
 | 
			
		||||
    value = 0;
 | 
			
		||||
    continuationShift = 0;
 | 
			
		||||
    while (!done) {
 | 
			
		||||
      nextVlqChunk = decodeBase64Char(str[position]);
 | 
			
		||||
      position += 1;
 | 
			
		||||
      nextChunkValue = nextVlqChunk & VLQ_VALUE_MASK;
 | 
			
		||||
      value += nextChunkValue << continuationShift;
 | 
			
		||||
      if (!(nextVlqChunk & VLQ_CONTINUATION_BIT)) {
 | 
			
		||||
        done = true;
 | 
			
		||||
      }
 | 
			
		||||
      continuationShift += VLQ_SHIFT;
 | 
			
		||||
    }
 | 
			
		||||
    consumed = position - offset;
 | 
			
		||||
    signBit = value & 1;
 | 
			
		||||
    value = value >> 1;
 | 
			
		||||
    if (signBit) {
 | 
			
		||||
      value = -value;
 | 
			
		||||
    }
 | 
			
		||||
    return [value, consumed];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}).call(this);
 | 
			
		||||
							
								
								
									
										47
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/coffee-script/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "coffee-script",
 | 
			
		||||
  "description": "Unfancy JavaScript",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "javascript",
 | 
			
		||||
    "language",
 | 
			
		||||
    "coffeescript",
 | 
			
		||||
    "compiler"
 | 
			
		||||
  ],
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Jeremy Ashkenas"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "1.6.2",
 | 
			
		||||
  "licenses": [
 | 
			
		||||
    {
 | 
			
		||||
      "type": "MIT",
 | 
			
		||||
      "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "node": ">=0.8.0"
 | 
			
		||||
  },
 | 
			
		||||
  "directories": {
 | 
			
		||||
    "lib": "./lib/coffee-script"
 | 
			
		||||
  },
 | 
			
		||||
  "main": "./lib/coffee-script/coffee-script",
 | 
			
		||||
  "bin": {
 | 
			
		||||
    "coffee": "./bin/coffee",
 | 
			
		||||
    "cake": "./bin/cake"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "node ./bin/cake test"
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "http://coffeescript.org",
 | 
			
		||||
  "bugs": "https://github.com/jashkenas/coffee-script/issues",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/jashkenas/coffee-script.git"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "uglify-js": "~2.2",
 | 
			
		||||
    "jison": ">=0.2.0"
 | 
			
		||||
  },
 | 
			
		||||
  "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.6.2",
 | 
			
		||||
  "_from": "coffee-script@1.x.x"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/README.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/README.markdown
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
commondir
 | 
			
		||||
=========
 | 
			
		||||
 | 
			
		||||
Compute the closest common parent directory among an array of directories.
 | 
			
		||||
 | 
			
		||||
example
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
dir
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
    > var commondir = require('commondir');
 | 
			
		||||
    > commondir([ '/x/y/z', '/x/y', '/x/y/w/q' ])
 | 
			
		||||
    '/x/y'
 | 
			
		||||
 | 
			
		||||
base
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
    > var commondir = require('commondir')
 | 
			
		||||
    > commondir('/foo/bar', [ '../baz', '../../foo/quux', './bizzy' ])
 | 
			
		||||
    '/foo'
 | 
			
		||||
 | 
			
		||||
methods
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
var commondir = require('commondir');
 | 
			
		||||
 | 
			
		||||
commondir(absolutePaths)
 | 
			
		||||
------------------------
 | 
			
		||||
 | 
			
		||||
Compute the closest common parent directory for an array `absolutePaths`.
 | 
			
		||||
 | 
			
		||||
commondir(basedir, relativePaths)
 | 
			
		||||
---------------------------------
 | 
			
		||||
 | 
			
		||||
Compute the closest common parent directory for an array `relativePaths` which
 | 
			
		||||
will be resolved for each `dir` in `relativePaths` according to:
 | 
			
		||||
`path.resolve(basedir, dir)`.
 | 
			
		||||
 | 
			
		||||
installation
 | 
			
		||||
============
 | 
			
		||||
 | 
			
		||||
Using [npm](http://npmjs.org), just do:
 | 
			
		||||
 | 
			
		||||
    npm install commondir
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/example/base.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/example/base.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
var commondir = require('commondir');
 | 
			
		||||
var dir = commondir('/foo/bar', [ '../baz', '../../foo/quux', './bizzy' ])
 | 
			
		||||
console.log(dir);
 | 
			
		||||
							
								
								
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/example/dir.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/example/dir.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
var commondir = require('commondir');
 | 
			
		||||
var dir = commondir([ '/x/y/z', '/x/y', '/x/y/w/q' ])
 | 
			
		||||
console.log(dir);
 | 
			
		||||
							
								
								
									
										29
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
var path = require('path');
 | 
			
		||||
 | 
			
		||||
module.exports = function (basedir, relfiles) {
 | 
			
		||||
    if (relfiles) {
 | 
			
		||||
        var files = relfiles.map(function (r) {
 | 
			
		||||
            return path.resolve(basedir, r);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        var files = basedir;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    var res = files.slice(1).reduce(function (ps, file) {
 | 
			
		||||
        if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
 | 
			
		||||
            throw new Error('relative path without a basedir');
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        var xs = file.split(/\/+|\\+/);
 | 
			
		||||
        for (
 | 
			
		||||
            var i = 0;
 | 
			
		||||
            ps[i] === xs[i] && i < Math.min(ps.length, xs.length);
 | 
			
		||||
            i++
 | 
			
		||||
        );
 | 
			
		||||
        return ps.slice(0, i);
 | 
			
		||||
    }, files[0].split(/\/+|\\+/));
 | 
			
		||||
    
 | 
			
		||||
    // Windows correctly handles paths with forward-slashes
 | 
			
		||||
    return res.length > 1 ? res.join('/') : '/'
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										42
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								node_modules/filesystem-browserify/node_modules/browserify/node_modules/commondir/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "commondir",
 | 
			
		||||
  "version": "0.0.1",
 | 
			
		||||
  "description": "Compute the closest common parent for file paths",
 | 
			
		||||
  "main": "index.js",
 | 
			
		||||
  "directories": {
 | 
			
		||||
    "lib": ".",
 | 
			
		||||
    "example": "example",
 | 
			
		||||
    "test": "test"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {},
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "expresso": "0.7.x"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "expresso"
 | 
			
		||||
  },
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "http://github.com/substack/node-commondir.git"
 | 
			
		||||
  },
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "common",
 | 
			
		||||
    "path",
 | 
			
		||||
    "directory",
 | 
			
		||||
    "file",
 | 
			
		||||
    "parent",
 | 
			
		||||
    "root"
 | 
			
		||||
  ],
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "James Halliday",
 | 
			
		||||
    "email": "mail@substack.net",
 | 
			
		||||
    "url": "http://substack.net"
 | 
			
		||||
  },
 | 
			
		||||
  "license": "MIT/X11",
 | 
			
		||||
  "engine": {
 | 
			
		||||
    "node": ">=0.4"
 | 
			
		||||
  },
 | 
			
		||||
  "readme": "commondir\n=========\n\nCompute the closest common parent directory among an array of directories.\n\nexample\n=======\n\ndir\n---\n\n    > var commondir = require('commondir');\n    > commondir([ '/x/y/z', '/x/y', '/x/y/w/q' ])\n    '/x/y'\n\nbase\n----\n\n    > var commondir = require('commondir')\n    > commondir('/foo/bar', [ '../baz', '../../foo/quux', './bizzy' ])\n    '/foo'\n\nmethods\n=======\n\nvar commondir = require('commondir');\n\ncommondir(absolutePaths)\n------------------------\n\nCompute the closest common parent directory for an array `absolutePaths`.\n\ncommondir(basedir, relativePaths)\n---------------------------------\n\nCompute the closest common parent directory for an array `relativePaths` which\nwill be resolved for each `dir` in `relativePaths` according to:\n`path.resolve(basedir, dir)`.\n\ninstallation\n============\n\nUsing [npm](http://npmjs.org), just do:\n\n    npm install commondir\n",
 | 
			
		||||
  "_id": "commondir@0.0.1",
 | 
			
		||||
  "_from": "commondir@~0.0.1"
 | 
			
		||||
}
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user