Euhm

I'm sorry, but this little experiment only functions properly in Safari 4 or Chrome.

Try it anyway

*Example* 1
var sys = require('sys');
var events = require("events"),
    Buffer = require('buffer').Buffer;

// execute fn (in the local process), finalized by invocation of callback
function execute(ctx, fn, callback) {
  var result;
  try {
    result = fn(ctx, callback);
  } catch (err) {
    // fn caused some trouble
    return callback(err);
  }
  if (result === callback || result === exports.LATER) {
    // fn is async and will invoke callback when done
    return callback;
  } else if (result === undefined) {
    // undefined (no) return value means the context is to be returned
    result = ctx;
  }
  callback(null, result);
}

exports.LATER = 1;

if (!Array.prototype.map) {
  Array.prototype.map = function(fun /*, thisp*/) {
    var len = this.length >>> 0;
    var res = new Array(len);
    var thisp = arguments[1];

    for (var i = 0; i < len; i++) {
      if (i in this) {
        res[i] = fun.call(thisp, this[i], i, this);
      }
    }
    return res;
  };
}
if (!Array.prototype.filter) {
  Array.prototype.filter = function (block /*, thisp */) {
    var values = [];
    var thisp = arguments[1];
    for (var i = 0; i < this.length; i++) {
      if (block.call(thisp, this[i])) {
        values.push(this[i]);
      }
    }
    return values;
  };
}
webkit-editor