Skip to content

Instantly share code, notes, and snippets.

@theefer
theefer / gist:3054503
Created July 5, 2012 15:55
Helper mixin to allow invoking the super method using the prototype chain
{
/**
* Invoke the super method corresponding to the caller (child-)method.
*
* Typically useful to call super constructors or destructors.
*
* @param args The arguments object of the caller method.
* @param superArguments Optional arguments to call the super method with.
* @return The result of calling the super method.
*/
/*!
* Reqwest! A general purpose XHR connection manager
* (c) Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/
function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&define.amd?define(a,b):this[a]=b()}("reqwest",function(){function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{},d;c.Accept=c.Accept||defaultHeaders.accept[b.type]||defaultHeaders.accept["*"],!b.crossOrigin&&!c[requestedWith]&&(c[requestedWith]=defaultHeaders.requestedWith),c[contentType]||(c[contentType]=b.contentType||defaultHeaders.contentType);for(d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d])}function generalCallback(a){lastValue=a}function urlappend(a,b){return a+(/\?/.test(a)?"&":"?")+b}function handleJsonp(a,b,c,d){var e=uniqid++,f=a.jsonpCallback||"callback",g=a.jsonpCallbackName||"reqwest_"+e,h=new RegExp("((^|\\?|&)"+f+")=([^&]+)"),i=d.match(h),j=doc.createElement("script"