add: } return rval; }; 
context: MochiKit.Format.numberFormatter = function (pattern, placeholder/* = "" */, locale/* = "default" */) {    // http://java.sun.com/docs/books/tutorial/i18n/format/numberpattern.html    // | 0 | leading or trailing zeros    // | # | just the number    // | , | separator    // | . | decimal separator    // | % | Multiply by 100 and format as percent    if (typeof(placeholder) == "undefined") {        placeholder = "";    }    var match = pattern.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);    if (!match) {        throw TypeError("Invalid pattern");    }    var header = pattern.substr(0, match.index);    var footer = pattern.substr(match.index + match[0].length);    if (header.search(/-/) == -1) {        header = header + "-";    }    var whole = match[1];    var frac = (typeof(match[2]) == "string" && match[2] != "") ? match[2] : "";    var isPercent = (typeof(match[3]) == "string" && match[3] != "");    var tmp = whole.split(/,/);    var separatorAt;    if (typeof(locale) == "undefined") {        locale = "default";    }    if (tmp.length == 1) {        separatorAt = null;    } else {        separatorAt = tmp[1].length;    }    var leadingZeros = whole.length - whole.replace(/0/g, "").length;    var trailingZeros = frac.length - frac.replace(/0/g, "").length;    var precision = frac.length;    var rval = MochiKit.Format._numberFormatter(        placeholder, header, footer, locale, isPercent, precision,        leadingZeros, separatorAt, trailingZeros    );    var m = MochiKit.Base;    if (m) {        var fn = arguments.callee;        var args = m.concat(arguments);        rval.repr = function () {            return [                self.NAME,                "(",                map(m.repr, args).join(", "),                ")"            ].join("");        }    }    return rval;};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js