function ensureOverloadTable(proto, methodName, humanName) {
    if (undefined === proto[methodName].overloadTable) {
        var prevFunc = proto[methodName];
        // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
        proto[methodName] = function() {
            // TODO This check can be removed in -O3 level "unsafe" optimizations.
            if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {
                throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
            }
            return proto[methodName].overloadTable[arguments.length].apply(this, arguments);
        };
        // Move the previous function into the overload table.
        proto[methodName].overloadTable = [];
        proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
    }            
}
// if the overload table doesn't yet exist.
if the overload table doesn't yet exist.
if the overload table doesn ' t yet exist .
function ensureOverloadTable(proto, methodName, humanName) {
    if (undefined === proto[methodName].overloadTable) {
        var prevFunc = proto[methodName];
        proto[methodName] = function() {
            if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {
                throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
            }
            return proto[methodName].overloadTable[arguments.length].apply(this, arguments);
        };
        proto[methodName].overloadTable = [];
        proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
    }            
}
function ensureOverloadTable ( proto , methodName , humanName ) { if ( undefined === proto [ methodName ] . overloadTable ) { var prevFunc = proto [ methodName ] ; proto [ methodName ] = function ( ) { if ( ! proto [ methodName ] . overloadTable . hasOwnProperty ( arguments . length ) ) { throwBindingError ( "Function '" + humanName + "' called with an invalid number of arguments (" + arguments . length + ") - expects one of (" + proto [ methodName ] . overloadTable + ")!" ) ; } return proto [ methodName ] . overloadTable [ arguments . length ] . apply ( this , arguments ) ; } ; proto [ methodName ] . overloadTable = [ ] ; proto [ methodName ] . overloadTable [ prevFunc . argCount ] = prevFunc ; } }
if the overload table doesn't yet exist.
if the overload table doesn ' t yet exist .
// Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. // TODO This check can be removed in -O3 level "unsafe" optimizations. // Move the previous function into the overload table.