function $new(klass) { var argNames = []; for (var i = 1; i < arguments.length; i++) argNames.push('args[' + (i - 1) + ']'); return new Function('klass, args', 'return new klass(' + argNames.join(',') + ');')(klass, [].slice.call(arguments, 1)); }