Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Last active February 23, 2017 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdeturckheim/a6a5c43b846b11e28eab5d99e4e103b7 to your computer and use it in GitHub Desktop.
Save vdeturckheim/a6a5c43b846b11e28eab5d99e4e103b7 to your computer and use it in GitHub Desktop.
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