<commit_before>/**
 * Limb Web Application Framework
 *
 * @link http://limb-project.com
 *
 * @copyright  Copyright &copy; 2004-2007 BIT
 * @license    LGPL http://www.gnu.org/copyleft/lesser.html
 * @version    $Id: limb.js 5817 2007-05-06 09:38:17Z tony $
 * @package    js
 */

if(Limb == undefined) var Limb = {};

String.prototype.trim = function()
{
  var r=/^\s+|\s+$/;
  return this.replace(r,'');
}

if(!Function.prototype.bind)
{
  Function.prototype.bind = function(object)
  {
    var __method = this;
    return function() {__method.apply( object, arguments );};
  };
}

if(!Function.prototype.bindAsEventListener)
{
  Function.prototype.bindAsEventListener = function(object)
  {
    var __method = this;
    return function(event) {__method.call(object, event || window.event);};
  };
}

Limb.Exception = function()
{
  if(arguments.length == 1 && Limb.isObject(arguments[0]))
  {
    this.type = arguments[0].type || 'LimbException';
    this.message = arguments[0].message;
    this.stack = arguments[0].stack || 'Stack is not available';
    this.file_name = arguments[0].fileName || 'File name is not available';<commit_msg>[svn r5897] -- a bit better version of Function.prototype.bind<commit_after>/**
 * Limb Web Application Framework
 *
 * @link http://limb-project.com
 *
 * @copyright  Copyright &copy; 2004-2007 BIT
 * @license    LGPL http://www.gnu.org/copyleft/lesser.html
 * @version    $Id: limb.js 5897 2007-05-15 08:22:49Z pachanga $
 * @package    js
 */

if(Limb == undefined) var Limb = {};

if(!String.prototype.trim)
{
  String.prototype.trim = function()
  {
    var r=/^\s+|\s+$/;
    return this.replace(r,'');
  }
}

if(!Function.prototype.bind)
{
  Function.prototype.bind = function( object, args )
  {
    var __method = this;
    var __args = args;
    return function()
    {
      __method.apply( object, __args || arguments );
    };
  };
}

if(!Function.prototype.bindAsEventListener)
{
  Function.prototype.bindAsEventListener = function(object)
  {
    var __method = this;
    return function(event) {__method.call(object, event || window.event);};
  };
}

Limb.Exception = function()
{
  if(arguments.length == 1 && Limb.isObject(arguments[0]))
  {
    this.type = arguments[0].type || 'LimbException';
    this.message = arguments[0].message;
    this.stack = arguments[0].stack || 'Stack is not available';
    this.file_name = arguments[0].fileName || 'File name is not available';
{'fraction_non_alphanumeric': 0.16236162361623616, 'fraction_numerical': 0.02788027880278803, 'mean_word_length': 3.510166358595194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4118858', 'n_tokens_mistral': 862, 'n_tokens_neox': 808, 'n_words': 171}