How to use the sys.inherits function in sys

To help you get started, we’ve selected a few sys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Rendez / node-dropbox / lib / util.js View on Github external
*  by Vincent Hellot .
 *
 * @author Luis Merino 
 */

var Multipart = exports.Multipart = function(boundary, useBuffers) {
    EventEmitter.call(this);
    
    this.boundaryLength = 0;
    this.randomBoundaryPartLength = 32;
    this.boundary = boundary || this.getBoundary();
    this.crlf = '\r\n';
    this.useBuffers = useBuffers;
};

Sys.inherits(Multipart, EventEmitter);

(function() {
    
    // algorithm borrowed from curl Curl_FormBoundary
    this.getBoundary = function() {
        var allowedChars = '0123456789abcdef';
        var boundary = '';
        var i = 0;
        var len = this.boundaryLength - this.randomBoundaryPartLength;
        
        for (i = 0; i < len; i++)
            boundary += '-';
        
        for (i = 0; i < this.randomBoundaryPartLength; i++)
            boundary += allowedChars[Math.floor(Math.random() * 15 + 1)];
github BilingualAphasia / AndroidBilingualAphasiaTest / androidsource / assets / oprime-server / src / lib / formidable / incoming_form.js View on Github external
this.maxFieldsSize = 2 * 1024 * 1024;
  this.keepExtensions = false;
  this.uploadDir = '/tmp';
  this.encoding = 'utf-8';
  this.headers = null;
  this.type = null;

  this.bytesReceived = null;
  this.bytesExpected = null;

  this._parser = null;
  this._flushing = 0;
  this._fieldsSize = 0;
};
sys.inherits(IncomingForm, EventEmitter);
exports.IncomingForm = IncomingForm;

IncomingForm.prototype.parse = function(req, cb) {
  this.pause = function() {
    try {
      req.pause();
    } catch (err) {
      // the stream was destroyed
      if (!this.ended) {
        // before it was completed, crash & burn
        this._error(err);
      }
      return false;
    }
    return true;
  };
github jifeon / autodafe / tests / test_app / models / test_super_model.js View on Github external
var Model = require('model');

var TestSuperModel = module.exports = function( params ) {
  this._init( params );
};


require('sys').inherits( TestSuperModel, Model );

var models = {};
TestSuperModel.model = function( clazz, app ) {
  var existed_inst = models[ clazz.get_some_importentd_value() ];
  return existed_inst || ( models[ clazz.get_some_importentd_value() ] = new clazz({
    app : app
  }) );
}
github Hypermediaisobar / hyperProxy / lib / node-mitm-proxy / proxy.js View on Github external
var Processor = function(proc) {
  this.processor = function() {
    this.methods = new proc(this);
    EE.call(this.methods);
  }
  sys.inherits(this.processor, EE);
}
github yui / yeti / lib / old / browsers.js View on Github external
function createBrowser (name, proto) {
    Browsers[name] = function () {
        Browser.apply(this);
    };
    sys.inherits(Browsers[name], Browser);
    for (
        var k in proto
    ) Browsers[name].prototype[k] = proto[k];
}

sys

Fixes using sys in your libraries without require all of Node to not depreciate stuff. Jeez.

BSD
Latest version published 12 years ago

Package Health Score

40 / 100
Full package analysis