Instantly share code, notes, and snippets.

@vdeturckheim /smartWrapper.js Secret
Last active Feb 23, 2017

Embed
What would you like to do?
function () {
runPreHooks(this, arguments);
let result;
try {
if (new.target) {
result = Reflect.construct(fn, arguments, new.target);
}
restult = fn.apply(this, arguments);
}
catch (err) {
runFaillingHooks(this, arguments, err);
throw err;
}
runPostHooks(this, arguments, result);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment