Skip to content

Instantly share code, notes, and snippets.

@mlippens
Last active December 25, 2015 05:29
Show Gist options
  • Save mlippens/6925391 to your computer and use it in GitHub Desktop.
Save mlippens/6925391 to your computer and use it in GitHub Desktop.
if (typeof define === "function" && define.amd) {
__define = function (name, deps, callback) {
var d, e;
if (typeof name !== "string") {
d = deps
} else {
d = callback
}
//wrapper fun
e = function () {
// a = count
// b = d.apply
// c = use array
var a, b, c = [];
for (a = 0; a < arguments.length; a++) {
c[a] = __contracts.use(arguments[a], "#{o.filename}")
}
b = d.apply(this, c);
return __contracts.setExported(b, "#{o.filename}")
};
if (!Array.isArray(deps)) {
deps = e
}
define(name, deps, e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment